You need to sign in to do that
Don't have an account?
Ken_Koellner
"For loop list batch size" limit of 200, what is it?
I know many of the limits in Apex have either been raised or removed. But "For loop list batch size" is still listed as 200.
Anyone know exactly what the limit is? It isn't clearly defined anywhere .
It seems to me I've had lists > 200 processed in a for lopp. Also, I don't think you need the nested for loop when fetching > 200 items from a SOQL query any more.
So, what is it?
My understanding is that this is the limit when carrying out a SOQL for loop of the form:
which allows you to step through the results in discrete batches. This is still recommended approach if you need to use DML on the resulting records, but I suspect that's an oversight, as the 200 record limit on a single DML operation has been upped to 1000 records these days.
I don' think you have to do that anymore.
Try this code--
I ran that anonymously in the System Log window and it worked just fine.
I know. Hence I said in my post that I suspect the DML recommendation is an oversight.
However, should you choose to carry out a batched SOQL for loop, the maximum batch size will be 200.
I can't see any reason to use batched SOQL for loops, as a list can accommodate the maximum 10,000 records that a SOQL query will return.