I have a form that I need to execute some code after the form is saved to a table. When the form is saved, an autonumber field (regmain_id) is generated. I need to use the value of 'regmain_id' in some code that will add rows to another table. Is there any way I can access the value of 'regmain_id' in PHP script that runs after the form is saved?
Forums
[SOLVED] Get value for autonumber field after form is saved
When I place a Debug action between the DB Save and Custom Code actions in the On Save event, I can see the following:
That's the value I need, but I cannot figure out how to access it in the next step.
Rick
[chronoform_data] => Array
(
...
[regmain_id] => 26
...
)
[chronoform_data_regmain_id] => 26
That's the value I need, but I cannot figure out how to access it in the next step.
Rick
Figured this out. When I was calling the field in some PHP, I was using:
$regid = $form->data['regmain_id'];
When I needed to call:
$regid = $form->data['chronoform_data']['regmain_id'];
Now it works!
$regid = $form->data['regmain_id'];
When I needed to call:
$regid = $form->data['chronoform_data']['regmain_id'];
Now it works!
This topic is locked and no more replies can be posted.