Can I get Sequece element value on AfterDataStored PHP event?

Hello.
In my list "Pedidos de Orçamento" I have a sequence element (Assigned after submission) called "request_id" which gives an output like:
"ZMMS_(current year)_(incrementing number)"an example of this would be "ZMMS_2018_000592"
In the form of the list, I have a PHP plugin event "onAfterDataStored". I want to retrieve that request id in the event.
I've tried this way:
$getRequestId={fzmms_quotereq___request_id};
But it doesn't seem to work... Shouldn't I be able to retrieve that value even if it is "Assigned after submission"? I mean, it is after the data is stored...
 
There is no 'onAfterDataStored', so I presume you mean 'onAfterProcess'.

Looking at the sequence element code, it looks like I'm not updating the form data for the sequence element, in the onAfterProcess handling. I'm a bit busy atm, but when I get a chance, I'll add that. However, I'll also need to test the ordering of when plugins run. I'm not sure if the element's onAfterProcess handling will run before any form plugin onAfterProcess handling.

Your alternative is to grab it yourself from the database with a query, using either the {rowid} placeholder or $formModel->formData['__pk_val'] as the PK id.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top