function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Maximum # of Statements

There is a maximum # of statements that you can execute during a single invocation of APEX.


Is there any way to programatically determine how close I am to that imit?  I have a recursive procedure that I want to run until it gets close to the limit and then turn itself off before it triggers an unrecoverable error. (you cannot catch that type of error)


While I'm at it I wouldn't mind knowing how close I am to running out of heap and levels of nesting.

Best Answer chosen by Admin (Salesforce Developers)