Standalone Form

Hi all Sorry to trouble everyone but Im struggling with saving data from a standalone form ( not panels ). I am saving the data using this
$this->supplierInvoice->update($this->form->getState());
$this->supplierInvoice->update($this->form->getState());
Howver I want to manipulate the 'budget' column to be 1 based on another condition. I cannot work out how to change the data and it be saved using the above. I tried this:
if($this->data['ourRefArray'] == null)
{
$this->data['budget'] = 1;
}
if($this->data['ourRefArray'] == null)
{
$this->data['budget'] = 1;
}
but it ignores the change. Am I missing something obvious?
2 Replies
awcodes
awcodes11mo ago
You need to call $this->form->getState() first. Save that to a $data variable. Then manipulate it and ->update($data)
David | Fortune Validator
legend, thank you.
Want results from more Discord servers?
Add your server