How do i add parent information to a teenage volunteer profile so that when a new volunteer fills out their profile, it creates a parent relationship and contact as well. I am using Profile-Create Mode to allow the data input on our website.
-
2Possible duplicate of How to allow parents to register children but still record their own info – Jon G - Megaphone Tech Jan 15 '18 at 21:34
You would need to created an extension using civicrm hook 'hook_civicrm_postProcess' which gets invoked when a civicrm form is submitted as you want the actions to be taken upon profile submission so this should work for you. In the hook you can create the relationships through the API call.
Detailed documentation on hook.
Hope this helps.
-
What I have read about Hook is that it is for forms? I literally created a profile and used it on our website to be filled out directly using theProfile-Create Mode. – Melinda Jan 16 '18 at 19:54
You would have to find out all the steps the profile goes through and potentially use the post or apiWrapper hook to create the parent. Difficult to say without knowing all the details.
But you could also use the Form Processor extension rather than creating a profile to get there? Documentation on the Form Processor extension can be found here: https://docs.civicrm.org/formprocessor/en/latest/