5,000 Deluge-statement limit - complete picture please?
I am trying to learn the complete picture about the 5,000 Deluge-statement limit.
We realize that scripts should normally NOT come near this number of statements. And that good code optimization will reduce the number of statements. And that the limit can be increased by Zoho, on a case-by-case basis.
Our reasons to better understand this is (1) good optimization for all scripts, (2) to be a good Zoho tenant, and (3) the potential occasional need to loop through more than 5,000 records.
Could someone kindly verify/correct/improve the below? Thank you!
======================
The limit is 5,000 statements executed within any single:
- On Load script?
- On Validiate script?
- On User Input script?
- On Success script?
- Custom Function?
What constitutes a statement that applies toward this count?
- Each semicolon? such as setting a variable, writing a value to a field, each hide/show/enable/disable, call of a function, alert, send email, etc? ie, pretty much each "Deluge Task" in the script builder?
- Each set of {} brackets? (such as each IF, ELSEIF, ELSE, or FOR EACH code section?)
- Each iteration of a FOR EACH loop, whether or not that iteration makes any changes?
- If a script includes calling a function, do the actions within the function count toward limit for the calling script?
- Other?
When the limit is reached, what is the result?
- error message?
- script terminated?
- all changes thus far rolled kept? rolled back?
- can the app admin be auto-emailed?
Are there acceptable ways to guard against this limit being reached?
- For manually-run functions that are primarily a loop: define a "range" within the FOR EACH to divide into smaller sets, and manually run for each set.
- Could a scheduled function call a set of other functions, each with an acceptable range? (or do they all apply to the calling function's limit)?
- Other??
All information/advice appreciated!