You need to sign in to do that
Don't have an account?

Changing batch size
I haven't worked with the Apex Batch capabilities yet... it looks like the batch size is set to 200. However, some limits are lower than that -- such as the number of callouts allowed in a transaction (10). Is it possible to change the batch size to a lower number?
Basically, I need to run through all of the records of a particular object that meet the criteria, and for each, call an external web service (callout) and update the record accordingly.
And incidentally, it seems that the query/callout logic and the update logic would have to -- or could -- use different batch limits.
You can use the Database.executeBatch(sObject className, Integer scopeSize) method to set the batch size.
Be sure the scopeSize should less than 200.
All Answers
Hi ryancha,
The short answer to your question is 'no'. Salesforce chunks the records returned by the Database.QueryLocator into batches of 200, and then passes each batch to the executBatch method. I don't think that the user can control the batch size.
Apex governer limis are reset for each execution of executeBatch() method.
You can find more details here:
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
Goto 'Batch Apex' -> 'Using Batch Apex'.
Hope this helps!
- A J
Could you please tell me why in Appex Data Loader you could change the batch size?
Regards,
You can use the Database.executeBatch(sObject className, Integer scopeSize) method to set the batch size.
Be sure the scopeSize should less than 200.
Thanks Harry!
This is great for my campaign member batch process as everywhere in Salesforce the batch size for CM's is 100 except batch apex, which defaults to 200. Now I can continue to use the effectively higher governor limits given batch size is 100 everywhere.
Thanxs...it works......