I have a Batch job with limit 20000 records in the Start method. And while executing I have put batch size to 900,

according to the documentation i should get Total No Records/Batch size this will result to 22.2 and making it to round off to 23. But in my case I am getting 30,32,27 batchs processed in total.

enter image description here

  • Can you share screenshot of execution flow and your batch start block. – Tushar Sharma Oct 1 '18 at 8:14
  • I have added the image – Arvind Oct 1 '18 at 8:52
  • As I can see last 3 counts are 30. Are you sure you are getting 30,32,27. Share the start block code as well. – Tushar Sharma Oct 1 '18 at 9:35
  • that was the latest. so its 30 30 and 27. it varies a lot. Assume it as a simple query like select id,name from account limit 20000 – Arvind Oct 1 '18 at 9:44
  • Is there any other user creating/deleting data in the background? – Tushar Sharma Oct 1 '18 at 9:47

You can set a custom batch size (up to 2000 records) by providing a QueryOptions header. But if a SOQL statement selects two or more fields of type long text, the batch size will never be more than 200 records.

So I think in above case it takes 200 as batch size and total batch executed (30+30+30+10)

  • No the external system is calculated in such a way that it'll accept only 23 batch records. where as in our case its 30. – Arvind Oct 1 '18 at 9:18
  • I thought your case was external one. – Pragati Jain Oct 1 '18 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.