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
RandyBartonRandyBarton 

Too Many SOQL Queries.... but no SOQL queries in loop?

I am receiving the Too Many SOQL Queries error sporadically in Production.  Each time the error refers to a different trigger and comes inconsistently after different processes with different users.  None of the triggers referenced have SOQL queries in a loop.  Any ideas for debugging.
Vidya DVidya D

You can enable debug logs and see the number of SOQL run. From the closer look of log, you should be able to find it out, if there are any recursive calls happening or specific user action is causing the problem. 

Compare the log  that throws too many SOQL with the one that doesn't throw this error for same button/ user action.
All the queries run for sharing are also get counted against number of SOQL.

For e.g. if this error is happeing for Save button action, then all the SOQL that run from clicking on Save button till flow returns page reference back is counted against SOQL limit.

Thanks,