CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding another contact field to Activities
Pages: [1]

Author Topic: Adding another contact field to Activities  (Read 560 times)

fen

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 13
    • CivicActions
  • CiviCRM version: 3.3-4.3
  • CMS version: Drupal 6/7
  • MySQL version: 5.1/5.5
  • PHP version: 5.3/5.4
Adding another contact field to Activities
February 03, 2011, 08:20:54 am
YouthBuild USA manages the operations of many "Sites" (a contact sub-type of Organization) and wants to use existing and custom Activity Types for logging phone calls, site visits, etc. that will all reference a Site.  So along with the source, assignee and target_contact_ids, I'd like to add a site_contact_id field and e.g. be able to find all the activities related to a Site.

I'll be diving into this next week, but wanted to know 1) if others have added additional contact_ids to Activity Types and if they have any suggestions, and 2) is there an extension mechanism for this now (I don't see one off-hand).

Any ideas on where to start will be greatly appreciated.  I'm thinking that I'll need a civicrm_activity_site table and hook_civicrm_post()...

Thanks,
=Fen

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Adding another contact field to Activities
February 03, 2011, 08:26:27 am
hey Fen,
create a custom field for the activity type of type contact reference.
then use hook_civicrm_contactListQuery to limit the autocomplete select list to only contacts of that subtype
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

fen

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 13
    • CivicActions
  • CiviCRM version: 3.3-4.3
  • CMS version: Drupal 6/7
  • MySQL version: 5.1/5.5
  • PHP version: 5.3/5.4
Re: Adding another contact field to Activities
February 03, 2011, 08:31:02 am
Thanks @lcdweb!

I'll let you know how that goes next week.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding another contact field to Activities

This forum was archived on 2017-11-26.