Firstly, I got error from my trigger that exceed max execution time.
Then I increased MaxJSTimeMs in shered.prop and It work.
But my data still growth and my trigger also take much time to calculate this data.
And the problem with max execution time is back.
So, Is there anyway to unlimit max execution time,
Or where can I put my script to run without time limit?
MaxJSTimeMs governs the javascript execution time for javascript blocks in serverside code.
MaxTimeToRunTrigMS governs the overall time a single trigger can spend for execution.
In any scenario an unlimited execution time is not advisable as there is possibility of execution flow getting stuck (either due to outbound http calls, disk io, or an infinite loop) and because there been no time limit, the trigger will be stuck forever in turn making the UI freeze (if this was UI invoked) or a batch job for that matter.
Any trigger doing something that is taking more than a few minutes, is either doing something wrong or is doing too much in itself. You should modularize your code in multiple components.
MaxJSTimeMs governs the javascript execution time for javascript blocks in serverside code.
MaxTimeToRunTrigMS governs the overall time a single trigger can spend for execution.
In any scenario an unlimited execution time is not advisable as there is possibility of execution flow getting stuck (either due to outbound http calls, disk io, or an infinite loop) and because there been no time limit, the trigger will be stuck forever in turn making the UI freeze (if this was UI invoked) or a batch job for that matter.
Any trigger doing something that is taking more than a few minutes, is either doing something wrong or is doing too much in itself. You should modularize your code in multiple components.
Hi Patel
So, I should modularize my code in multiple components.
In my case, my trigger is executed by one action from head obj,
read all record that in condition from obj1 then update and create in obj2.
Could you give me an example to modularize?
Thanks.
Kasipat