I have a form where I use a calc element to display some additional info depending on what a user selects in the form. So say a user wants to write a report for a customer, and he selects the customer from a databasejoin, the calc element shows the last {x} reports for that customer.
Problem is that now the calc saves those {x} reports in a field of this report, meaning that all that data is saved {x} times in my table. Now I could use a php plugin to empty that field after saving, and that eliminates those {x} duplicates, but I also use a logs plugin, with the 'compare data' function, meaning the last {x} reports are also saved in the _logs table.
So I want to empty the calc value before the form info is saved, hoping that this would mean the logs plugin uses the empty value, and doesn't save all this extra data. I made a php plugin, to run onBeforeProcess, with this code:
But this doesn't seem to work on calc elements.
Any ideas how i should go about this??
Problem is that now the calc saves those {x} reports in a field of this report, meaning that all that data is saved {x} times in my table. Now I could use a php plugin to empty that field after saving, and that eliminates those {x} duplicates, but I also use a logs plugin, with the 'compare data' function, meaning the last {x} reports are also saved in the _logs table.
So I want to empty the calc value before the form info is saved, hoping that this would mean the logs plugin uses the empty value, and doesn't save all this extra data. I made a php plugin, to run onBeforeProcess, with this code:
Code:
$formModel->updateFormData('table_name___element_name', '', true);
Any ideas how i should go about this??