Hi all, General question...what is the ideal struc...
# suitescript
a
Hi all, General question...what is the ideal structure for different validations being applied to the same record? Is it better to combine them all into one "validation" script? Right now, I have a them in different scripts as some are more complex logic. How would this affect things governance- wise? Maintenance-wise?
c
If volume/performance is a concern, it’s definitely better to isolate validation functionality into a single client side script if possible. This improves performance and allows you to more tightly control the logic within the script. Maintainance wise, make sure to use lots of functions to separate out logic. Governance wise, I believe the limit is 10 client side scripts deployed to a single record - worth noting that you want to make sure not to overload a single script to exceed the 1000 point usage limit.
e
Hm personally, I much prefer to organize my code by feature, not by script type or technical function
If you have validation rules on a Sales Order for, say discount eligibility and then customer credit checking, I'd likely have separate modules for the discount logic and the credit logic
Note that doesn't necessarily mean you have separate Script records. You might have a single entry point client script, but that entry point would delegate to separate modules
(although I do tend to start with separate entry points entirely, unless we can prove that's the source of a problem)
a
Got it, thank you!