+ Start a Discussion

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 

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.

Satish Kumar