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
christwin123christwin123 

Method Error - Too many SOQL queries: 101

Hi All,

My Method needs to Execute a Query inside a Loop which brings it more than 100 Queries as the number of records are more than 100 .

Could someone please Suggest some alternate Method to have the Queries Executed 

Thanks,
Christwin
Satish_SFDCSatish_SFDC
Most of the times we can just remove the query from the loop and then place it out.
Probably you can build a list or set and add the Id's in a set.
You can then fire a single query for all the ID's in the set.

In any case, please post your code, so we can optimize that.

Regards,
Satish Kumar