A very quick article on how to check what the statement execution limit is on the Zoho application you are working in.
Why?
Our use-case is that an application we built in Zoho Creator was hitting statement execution limits and rather than proposing an upgrade or add-on to the subscription plan; we wanted some proof using code.
How?
We're going to use a quick snippet of some code. So create a function in the Zoho App you are checking, or somewhere you can write some Zoho Deluge code.
Note that requesting an increase of the limit or an upgrade to the subscription will likely to have to be asked directly to Zoho rather than using the online subscription plan management section.
Statement Execution Limit is 5000
The following will run resulting in the error "Number of statement execution limit exceed Line:(10)" but it will info out each number to increment:
// l_Loop = " ".leftpad(5000).replaceAll(" ", ",").toList(); // for each index v_Iteration in l_Loop { info v_Iteration; } // yields an incremental count from 0 to 4999
- //
- l_Loop = " ".leftpad(5000).replaceAll(" ", ",").toList();
- //
- for each index v_Iteration in l_Loop
- {
- info v_Iteration;
- }
- // yields an incremental count from 0 to 4999
Statement Execution Limit is 10000
If the below runs successfully, then the limit is at least 10'000:
// v_Counter = 0; l_Loop = " ".leftpad(9995).replaceAll(" ", ",").toList(); // for each v_Iteration in l_Loop { v_Counter = v_Counter + 1; } info "Statement execution limit is 10000";
- //
- v_Counter = 0;
- l_Loop = " ".leftpad(9995).replaceAll(" ", ",").toList();
- //
- for each v_Iteration in l_Loop
- {
- v_Counter = v_Counter + 1;
- }
- info "Statement execution limit is 10000";
Statement Execution Limit is 50000
If the below runs successfully, then the limit is at least 50'000:
// v_Counter = 0; l_Loop = " ".leftpad(49995).replaceAll(" ", ",").toList(); // for each v_Iteration in l_Loop { v_Counter = v_Counter + 1; } info "Statement execution limit is 50000";
- //
- v_Counter = 0;
- l_Loop = " ".leftpad(49995).replaceAll(" ", ",").toList();
- //
- for each v_Iteration in l_Loop
- {
- v_Counter = v_Counter + 1;
- }
- info "Statement execution limit is 50000";
Additional Note(s):
- Observation #1: Method Chaining: Contrary to my previously held belief, method-chaining still counted as separate statements; this is not true as the following counts 3 statements executed prior to the loop:
copyrawBut the following counts as 1 statement prior to the loop:
// l_LoopInnerInner = " ".leftpad(5000); l_LoopInner = l_LoopInnerInner.replaceAll(" ", ","); l_Loop = l_LoopInner.toList(); // 3 actions so far // for each index v_Iteration in l_Loop { info v_Iteration; } // yields an incremental count from 0 to 4997
- //
- l_LoopInnerInner = " ".leftpad(5000);
- l_LoopInner = l_LoopInnerInner.replaceAll(" ", ",");
- l_Loop = l_LoopInner.toList();
- // 3 actions so far
- //
- for each index v_Iteration in l_Loop
- {
- info v_Iteration;
- }
- // yields an incremental count from 0 to 4997
copyraw// l_Loop = " ".leftpad(5000).replaceAll(" ", ",").toList(); // 1 action so far // for each index v_Iteration in l_Loop { info v_Iteration; } // yields an incremental count from 0 to 4999
- //
- l_Loop = " ".leftpad(5000).replaceAll(" ", ",").toList();
- // 1 action so far
- //
- for each index v_Iteration in l_Loop
- {
- info v_Iteration;
- }
- // yields an incremental count from 0 to 4999
- Observation #2: Setting a loop with leftpad limited to 100,000: Our trick of using the leftpad() method to build a list of any number is actually limited to 100000 as you will get an error saying: "Unable to execute function because the whitespaces to be padded cannot be more than 100000".