Hello to everyone,
I need to prevent save of a record (in create or in edit mode) under specific condition:
I create before_save hook. In the body of the function, I made a db query to check the condition and if the condition is satisfy, prevent the save action and redirect to a URL.
Now, I have this problem: If we are in update mode, if I redirect to a EditView for the same $bean->id I lost the new informations that save operation must override.
If we are in create mode, and redirect to EditView, I reach a page to create a new record with all fields unfill.
How can I mantain the changes without loose all informations that user filled?
Goodmorning,
I have opted for a solution that I found in internet. (the example is for sugarcrm, but I tried it and works for suitecrm too).
Here a link of the example.
I hope that this helps other.