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) »
  • custom form hook, write primary e-mail adress
Pages: [1]

Author Topic: custom form hook, write primary e-mail adress  (Read 434 times)

rebootl

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Joomla 2.5
  • MySQL version: ?
  • PHP version: ?
custom form hook, write primary e-mail adress
April 07, 2014, 09:43:05 am
Hello

I've already posted in the profile subforum: http://forum.civicrm.org/index.php/topic,32158.0.html but I think this has actually turned into a developer question. I hope it's okay to post an updated question here.

As described we're using a form where users can register. Afterwards the logged in user can fill another custom form registering as e.g. "Supporter" w/ additional data. We also want to give the possibility to enter an additional email address (in the form this one is defined as E-Mail contactperson).

The problem is now that when entering a different email address than at the first registration the contact is not updated but instead another one is created. This makes sense due to the deduping rules. However I did not find a way to adapt the dedupe rules appropriately...

So my idea was to add a primary e-mail address field in the second registration form and use a custom hook (override) to fill it automatically w/ the respective address. Does this make sense?

I've managed to create an override for this and I think it should be possible using
hook_civicrm_buildForm like in the reference example (http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hook_civicrm_buildForm
But I was unable to find the respective field name for the primary email address from php...
For example the $form-> members(?) (sorry I'm missing the correct word here)

I'm a bit lost on this and already spent too much time on it. I'd be glad for any pointers.

Thanks in advance

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: custom form hook, write primary e-mail adress
April 08, 2014, 02:23:05 am
I am answering on http://forum.civicrm.org/index.php/topic,32158.0.html as I have some questions about the profiles you are using.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • custom form hook, write primary e-mail adress

This forum was archived on 2017-11-26.