You need to sign in to do that
Don't have an account?
Jan Matteson
Flow from process builder errors on data load - Too many soql queries
I have a simple flow that changes the owner on an opportunity to the account owner upon creation. It is called from process builder when the opportunity is created. Three simple steps:
1. Lookup Opportunity (to get account id)
2. Lookup Account (to get owner)
3. Update Opportunity (with owner)
It works fine when adding opportunities from the UI or in small batches but any large load causes too many SOQL queries. My opportunities are coming from another system so I have to be able to handle volume. I have no loops in the flow and can't batch because it is triggered by process builder.
Any ideas would be appreciated.
1. Lookup Opportunity (to get account id)
2. Lookup Account (to get owner)
3. Update Opportunity (with owner)
It works fine when adding opportunities from the UI or in small batches but any large load causes too many SOQL queries. My opportunities are coming from another system so I have to be able to handle volume. I have no loops in the flow and can't batch because it is triggered by process builder.
Any ideas would be appreciated.
Looking at the debug log it is obvious that salesforce is looking at the entire data load as one batch - first test is testing WF criteria on all, then it does the flow interview on all, and then it does the action on all. Unfortunately, I don't know how to bulkify the flow. When I have flows with loops, I add to a collection and do the dml action outside the loop. In this case, I just have three steps that need to be taken on every record but I don't know how to gather them into a collection before passing to the flow.
Where you able to find a solution to your problem? I am running into the exact problem. I am just trying the run the same three steps as you are but can get it to work on batches.
Here is the idea to follow:
https://success.salesforce.com/ideaView?id=08730000000DhBlAAK