function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aaron AttardAaron Attard 

Flow error Too many SOQL queries: 101

Hey guys

I'm trying to run the flow hereunder but I am getting an error because I am trying to loop through multiple records (approx 2000). The flow works great when I change the filter criteria to only loop through 50 records but I would like to loop through all of them at one go. Is there a way I can do this using the visual flow builder? Unfortunately I'm not that experienced in APEX code.

User-added imageThanks
Aaron
Ajay K DubediAjay K Dubedi
Hi Aaron,

I have gone through your question. The issue you are facing is a very known issue.
You may find some help in the link below - 

https://developer.salesforce.com/forums/?id=9060G000000BiK2QAK

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
Aaron AttardAaron Attard
Hi Ajay

The suggestions in the provided link are to enable the "Bulkification Setting" critical update, however I think this is already Activated.
Can you please be more specific as what I can do in my flow to avoid this error?

I think it's somwhere between "get employment records" and loop through "bonus records" that is causing the issue.

Thanks
Aaron