ScheduledTrigger flow Error: Too many SOQL queries: 201 #372
Replies: 2 comments 1 reply
-
@monicalasich it sounds like you have a bulkification issue in your before trigger - Apex Rollup doesn't run in any before context, but if Opportunity is the parent and there are multiple records being updated at once, your existing triggers are going to run by default. That means you need to update whatever code is in that before trigger to actually only query things in bulk. |
Beta Was this translation helpful? Give feedback.
-
@monicalasich How were you able to set up the scheduled flow, without using {!$Record__Prior} in the flow? Im currently trying to set up a scheduled flow to count all the custom objects on an Account, every night. cc: @jamessimone |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I've created a scheduled triggered flow to run every night to calculate all rollups with the parent object set as Opportunity. I followed the instructions and haven't added an object to the flow to make sure the transaction is bulkified. The problem is that we have a BeforeTrigger on opportunity failing right after for every individual Opportunity that has been updated via the scheduled trigger thats throwing the error Too many SOQL queries: 201. Am I doing something wrong or is this expected behavior? For reference, i have used the action Full Recalc CMDT-driven Invocable and listed the CMDT I want to be calculated. What process has anyone followed to set up their ScheduleTriggered?
I look forward to your response.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions