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
chesschess 

200000 script statement limit

We have an application where we process several orders in a batch. to process each order requires quite a bit of work and hence we have decided to have a batch size of 1 and process each order in a batch. That way the governor limits get reset for each order. now we are encountering a problem where suppose  an order has 1000 lines, we are hitting the script statement limit. It seems that to process these 1000 lines we can atmost have 200 scripts statements for each line before we run out of limits.

I find this restriction quite limiting. while i agree with the SOQL and memory limits, not being able to execute more script statements per batch seems very restrictive.

is there a way salesforce can increase the limits based on a fee. that way, our larger customers can pay an additional fee to process bigger orders.

so my question is if governor limits are fixed or can they be flexible based on a fee.

 

AVictorioAVictorio

Have you looked at revising your apex code? If you're hitting this limit due to a trigger there may be a way to improve it. See also: http://wiki.developerforce.com/index.php/Apex_Code_Best_Practices

yashagarwalyashagarwal

You can use future method to increase you limit , this can be called asynchronously  from the apex trigger  using the

 

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

 

The script statement limits for future method is higher 1,000,000 and can probably help solve your problem.

 

Let me know if this helps.

chesschess

Thanks for all your responses. I dont have triggers. I simply need to have some complicated logic that cannot be limited to less than 200 script statements per order line. Even i were to reduce the script statements to 100, i am then limited by a 2000 line order.

This limit (especially the script statments) seems quite arbitrary to me. Do you know if i could talk to someone at SF (product management perhaps) to discuss my usecase.

scenario based questionsscenario based questions

Can any one tell me that what is the governor limit for script ???