I can't find it in the docs, but there has to be a maximum. In a salesforce flow, what is the maximum number of records a fast lookup can return. What happens if the number is higher than the max?
-
1This doesn't seem to be explicitly mentioned in the documentation as I have tried going through the Developer docs. I suspect it will be linked to the Apex limitation on the maximum heap size or the SOQL limit of 50,000 rows developer.salesforce.com/docs/atlas.en-us.apexcode.meta/… – Dave Humm May 19 '16 at 15:02
I just tested this, and there's no limit for the number of rows a Fast Lookup can return directly, but you are bound by the governor limits in Apex Code and Visualforce: heap size, query row limits, query limits, view state size, and CPU time. Attempting to update those records may also run into other limits, such as the DML statement limit and the DML total record limit (plus any of the previously mentioned limits).
-
Thanks and it turns out that looping through them the most likely limit that will be hit is: Maximum number of executed elements at run time 2,000 so it's very likely less than 2000 rows that can be handled and dependent on the complexity of the flow. The more complex, the lower the number of rows that can be handled, rendering it only useful for very simple cases, anything else is better off as a trigger. – Scott Morrison May 19 '16 at 20:16
-
@ScottMorrison Mostly true. However, every "screen" is a separate transaction, which is how you could still process more than 2k records (I've actually built something like this), but then you still risk the other limits, depending on how it's laid out. – sfdcfox May 19 '16 at 20:50
-
If it's an auto-executing flow triggered from process builder there aren't any screens so in that case everything appears to be in the same transaction – Scott Morrison May 25 '16 at 19:32
It's a bit late to be chiming in on this, however, I'll comment in case anyone finds this thread in the future.
If you are in an auto-executing flow, you can put in a wait element and that will reset the transaction counter the same as a screen will.