-1

System.LimitException: Too many SOQL queries 101

I am getting this error on below line

List <Call_Report_Attendees__c> cra =  [Select id, 
currencyIsoCode,Call_Report__c from Call_Report_Attendees__c where Call_Report__c 
in:setAttendeeId];

Please help me remove this error.

0

2 Answers 2

1

You are hitting the governor limits. I guess you are using the line inside a for loop.

List cra = [Select id, currencyIsoCode,Call_Report__c from Call_Report_Attendees__c where Call_Report__c in:setAttendeeId];

Try using this line outside the loop if you are currently using inside any loop.

0

You are hitting the Governor limit thats why error has been thrown.Please refer this post I am getting this error: System.LimitException: Too many SOQL queries: 101

And refer to the best practices for avoiding SOQL queries 101 error. https://help.salesforce.com/apex/HTViewSolution?urlname=System-LimitException-Too-many-SOQL-queries-101&language=en_US Thanks.

Not the answer you're looking for? Browse other questions tagged .