Update another field from a field of same table

fujitsuDev

New Member
Hi,

I would like update value of yes/no field but after that it execute they validations.

An "expiration_date" field check a yes/no "reset_date" field at submit.
My problem: this yes/no field is recorded in DB as yes (1) and I wont.

I want this number to go back to 0 systematically, even if it has to be done in a delayed way. Normally, it's very simple, right? Well not in my case: from my field or elsewhere, I can't UPDATE another field from the same table.

I tried from:
  • My element expiration_date element
  • The form PHP plugin
  • The scheduler PHP plugin
Many methods none of which work... It not recognising "=". It should be.

Short version :
expiration_date checks if reset_date
if reset_date == 1 (yes) so refresh expiration date
if reset_date == 0 (no) so nothing to do
finally, reset_date must staying to 0 (no) and don't record 1 (yes), in all cases


Thanks for help.
 
Last line in your code should be something like

PHP:
$formModel->updateFormData('form_name___reset_date',  '0',  true);
 
I've tried this, but wrong... I must have done something like that:

Code:
$formModel->updateFormData('{form_name___reset_date}',  0);
:eek:

Thank you both :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top