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
ScorpionKingScorpionKing 

Too many script statements: 200001..

Please suggest something so i can restrict this.....

thanks...
sforce2009sforce2009
Use multiplce apex classes links chunks.. do not use a apex class with too much code. there is a limit for that
wesnoltewesnolte

Hey

 

Your code(or the way it is called) needs to be optimised. Unfortunately that is almost definitely going to be alot of work. There are some resources that may help, depending on what you are doing

 

http://blog.sforce.com/sforce/2008/10/group-sum-and-o.html

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=5347&view=by_date_ascending&page=1 

 

Wes 

Edwin VijayEdwin Vijay

You will get this error when the number of executing statements is large... Even if your code is small and you have a loop which keeps on executing many times you may get this error...

 

There is no other go than to optimize your code...

ScorpionKingScorpionKing
Thanks for the reply's...but the class XMLDom is the only class that comes for parsing my XML which i get from webservice call.....
Does this class accumulates that many Script statements if my response string is large ??

i jsut wanna put a restriction so that atleast my application runs fine before it hit the limit.....m tryin putting some limits as changing my code certainly not an option as it has lots of functionalities.....
wesnoltewesnolte

Hey

 

The size of the reply is probably your problem. The getScriptStatements() method of the Limits class(

http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_methods_system_limits.htm?SearchType=Stem

 

) can help you figure out at which point the governor limit is hit. Simply insert a few of the method calls in sensible areas an check the debug logs.

 

Cheers,

Wes