Update Conditions by aid

rafaelscouto 07 Feb, 2019
good afternoon

I'm having a little problem,.

I created a php function that generates for me a protocol number according to the year, month and id (aid) that is generated by the chronoforms.

Except when doing the update, I'm not able to write this field according to the id that was generated.

For example:
I know that in the field "update conditions", if I do for example: name: {date: name} I can save the field that I want according to the name, but in this case if the same name is used in filling the form, the my protocol field will always be superimposed.
 
That's why I need it for "aid."

I also need, that this field protocol, be sent by email, how can I get it and send along with the email.

Follow the debug

-----------------
[0] => INSERT INTO `udgtx_z_ouvidoria-cadastrar` (`created`, `nome`, `celular`, `email`, `secretaria`, `regiao`, `assunto`, `midia`, `descricao`, `aid`) values ('2019-02-07 18:54:54', 'RAFAEL COUTO', '(74) 98819-9939', 'rafaelscouto@gmail.com', 'SMADM', 'SEDE', 'ASSISTÊNCIA SOCIAL', '', 'tryjrtyj', '');
)

[var] => Array
(
[created] => 2019-02-07 18:54:54
[nome] => RAFAEL COUTO
[celular] => (74) 98819-9939
[email] => rafaelscouto@gmail.com
[secretaria] => SMADM
[regiao] => SEDE
[assunto] => ASSISTÊNCIA SOCIAL
[midia] =>
[descricao] => tryjrtyj
[aid] => 34
)

)

[funcao_gera_protocolo] => Array
(
[returned] =>
[var] =>
)

[save_data16] => Array
(
[data] => Array
(
[protocolo] => 201902000034
)

[_success] => Data saved successfully
[log] => Array
(
[0] => UPDATE `udgtx_z_ouvidoria-cadastrar` AS `Prot` SET `protocolo` = '201902000034' WHERE `aid` = '';
)

[var] => Array
(
[protocolo] => 201902000034
)

)
-----------------
healyhatman 07 Feb, 2019
Answer
Shortcode
{var:first_save_data_action.aid}
PHP
$this->get("first_save_data_action.aid")
healyhatman 07 Feb, 2019
Great, set my post above as the answer please
This topic is locked and no more replies can be posted.