I did a form that receive a token to find a record. I did it many times before without any problem. Now I need it to find a record, and if this record doesn't exist, create a new one with the token number.
So I need to set the record key, like this:
$form->data['record_key'] =$form->data['token'] ;
I tried it, in many places.
First I tried on Events/On Load/On Empty Results, with a Custom Code.
Then I tried before Db Save.
I even tried on a Custom Element on the form it self.
Never works. At the end, the record_key is always null.
Where is the right place to do it, and what is the exact sintax for it?
Thansks
So I need to set the record key, like this:
$form->data['record_key'] =$form->data['token'] ;
I tried it, in many places.
First I tried on Events/On Load/On Empty Results, with a Custom Code.
Then I tried before Db Save.
I even tried on a Custom Element on the form it self.
Never works. At the end, the record_key is always null.
Where is the right place to do it, and what is the exact sintax for it?
Thansks
Hi rslyra,
That code looks good, it needs to be inside <?php ?> tags and in a Custom Code action set to Controller Mode. Just what position it should be in depends on the logic you are using but certainly before the DB Save action.
You can use a Debugger action (or actions) to check what the values are.
Bob
That code looks good, it needs to be inside <?php ?> tags and in a Custom Code action set to Controller Mode. Just what position it should be in depends on the logic you are using but certainly before the DB Save action.
You can use a Debugger action (or actions) to check what the values are.
Bob
This topic is locked and no more replies can be posted.