You need to sign in to do that
Don't have an account?
guest1231231
Too Many Script Statements
When my test code bulk inserts 100 tasks it does not throw any exceptions, but when I increase it to 200 I get "System.Exception: Too many script statements: 50001".
Why would it throw an exception at 200 but not 100 insertions?
-Thanks
You're running into the governor limit that enforces the number of script statements executed. It doesn't relate directly to the insertions, aside from the fact that an insert statement is a single statement. It's just that the total amount of code you're running in a single request has exceeded the limit.
What am I doing wrong here? I am still new to Apex but I followed the bulkifying code best practices to the best of my ability. What is causing this code to hit too many script statements?
-Thanks