How to use calc element without saving

PvN94

Member
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:
Code:
$formModel->updateFormData('table_name___element_name', '', true);
But this doesn't seem to work on calc elements.

Any ideas how i should go about this??
 
Set in your calc element access section ->store in db to 'No'.
The text in tooltip for this option is wrong.
 
Well, that was simple. I looked for such an option, but somehow either decided that it wouldn't be in the access tab, or completely missed it when looking.

Thanks for pointing me in the right direction ;)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top