Saving resource when executing Action
Good evening,
Is it possible for me to programmatically save edited resource fields before the code of an action gets executed? I can't find much in the documentation (Or I'm tired π΄ )
Reason why this is important
I had a customer e-mail me today that generating an
order
from a quotation
(both resources) was broken. After some testing, I'm highly under the suspicion that they simply forgot to save the Quotation resource before clicking the action to turn it into an Order. A silly mistake, but this also implies its apparently not user-friendly enough, so I'd like to fix it if possible, preferably programmatically.
Making every field autosave through is not an option because its simply too many fields (30 something), and it's also kinda ugly.
Would there be a method or (livewire) event I could use to save the resource fields before (or during) gets called? Or would there be hack to get around this?
Thanks in advance!
Code of the defined actions for some clarity
code of the action which needs the resource to be saved
2 Replies
Solution
Maybe something like this could work?
My goodness that is perfect, thank you so much! π