You need to sign in to do that
Don't have an account?
happy tester
System.LimitException: Too many SOQL queries: 101
We have triggers running to update Contact when Campaign Member Status is changed for different types of Campaigns. Each trigger has filtering, that means only those Campaign Members fall in a particular campaign will update Contact. We have another new campaign and just developed a simple trigger to update Contact. The trigger itself is running fine but when we deployed to production, another two test class has error "System.LimitException: Too many SOQL queries: 101". One is related to Campaign while the other is related to Contact. May I know why?
It is the salesforce standard limit, check this link for salesforce Governors limits
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm
Check this link for Apex code best practices
http://wiki.developerforce.com/page/Apex_Code_Best_Practices
You could get this error because you might not have bulkified your triggers.
Check if you are trying to use a SOQL query inside a for loop.
if your loop runs 100 times then soql query gets excuted 100 times and would hit the governor limits.