-1

Its possible to set default values of a membership custom fields through a civiCRM hook? I have seen that the values are generated by ajax when membership type is changed but i dont see any hook for this.

thanks!

1

you should be able to do this with the buildForm hook that is described here: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/. Keep in mind that the custom fields are actually posted on a different form, so I usually first dump the form names to the log with Civi::log()->debug so I can check what the name I need is.

  • Thanks for your recommendations, finally, I found the form that works with the custom fields in the memberships: CRM_Custom_Form_CustomDataByType – Cesar Oct 16 '18 at 15:59

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.