- Issue created by @luke.stewart
- 🇳🇿New Zealand petednz
Would another option be, much like the Contact ID field, to have the Activity ID field available via the UI as a hidden field, then it might open other options for us.
1.0 Problem/Motivation
Activity ID not available in Webform Handlers
2.0 Detailed steps to reproduce (embed screenshots)
Aim is to do some custom processing using the activity id of a created activity, in a Custom Webform Handler.
The activity id is available as a token - however I can't seem to figure out where to find it in the code base.
The Activity Save happens in processActivities - called in postSave. So any other handler I need to call at this point.
The processActivities saves the id into $this->ent['activity'] however this is not available outside of the WebformCivicrmPostProcess.
I'm curious as to why activity saving is in postSave but most other work is done in pre save.
3.0 Proposed resolution
Is there a nice way to get the activity id in a Custom Webform Handler - or should we look at adding activity id as a hidden field. I assume all that is requires for this is to add to the fields list (tested and now it shows)
and then populate that. However to do so - I think would require shifting the saving of Activities from postSave to preSave?
Active
6.3
Code
Would another option be, much like the Contact ID field, to have the Activity ID field available via the UI as a hidden field, then it might open other options for us.