This may be general knowledge to some.
Thank you support for clarifying.
So it is not possible to execute a rule only on save.
In that case, it is important to note what triggers the BO to re-calculate, evaluate and execute ALL rules.
Triggers:
- [Known] When there is a dynamic rule that depends on the changed attribute
- When there is a filter query in a ref attribute that depends on the changed attribute
- Shortcut attribute is present on your form.
Be mindful that:
(Correct me if I'm wrong here)
a) Value of an calculated attribute on the form will change every time the user changes any of the value attributes mentioned in rule conditions (dynamic or not).
b) Sometimes if the IS UNDEFINED condition is used can also potentially cause incorrect value to be stored in DB.
c) When your BO uses lots of aggregate functions like calculating a total value of hundreds or thousands of objects, this is done on every re-calculation.
d) Extra care should be taken with PROTECT & READ PROTECT rule actions. Especially when calculated attributes are used to execute them.
e) If you BO has a high number of rules, eg.. FIND rules etc ... that all of those rules will be evaluated causing potential downgrade in performance
Some theories on the way it could be improved.
i) Add the ability to set the rule to execute only on Save.
Ignoring all the dynamic re-calculation triggers. They could still be evaluated, but placed on the agenda to execute on save.
This will not affect anyones' already built apps as the developer would manually have to tick this box.
ii) If that is not possible, consider removing the shortcut & filter query triggers.
iii) Not having every single rule executed, whether you want it to or not, would increase performance
Thank you for reading.
Cheers