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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • hook for viewing a contact
Pages: [1]

Author Topic: hook for viewing a contact  (Read 382 times)

rulley

  • I’m new here
  • *
  • Posts: 13
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal
  • MySQL version: 5.5.25
  • PHP version: 5.4.4
hook for viewing a contact
February 12, 2014, 11:41:42 am
Hello.. trying to update a custom field upon viewing an individual. is there a hook for that? I see there is
if ($op == 'view' && $objectName == 'Individual')

but not sure if this is right? any ideas?

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: hook for viewing a contact
February 12, 2014, 11:56:18 am
If you use Drupal, you can find out a lot about what hooks are available by installing "civicrm_developer" on your dev site. See links from http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference#HookReference-Inspectinghooks

rulley

  • I’m new here
  • *
  • Posts: 13
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal
  • MySQL version: 5.5.25
  • PHP version: 5.4.4
Re: hook for viewing a contact
February 12, 2014, 12:50:44 pm
thx that is an awesome module... was able to use the hook below on contact view to update a custom field:

function defaultdates_civicrm_links( $op, $objectName, $objectId, &$links ) {
 
  if ($objectName == 'Contact' && $op == 'view.contact.activity') .........

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • hook for viewing a contact

This forum was archived on 2017-11-26.