You need to sign in to do that
Don't have an account?
Paras Jain
I am getting sometimes error when submit a page System.LimitException: Too many SOQL queries: 101
System.LimitException: Too many SOQL queries: 101
Error is in expression '{!saveclosedwonpage}' in component <apex:commandButton> in page nonapaclosedwonform: Trigger.InvestmentCriteriaUpdate: line 29, column 1
Trigger.InvestmentCriteriaUpdate: line 29, column 1
there are around 11 triggers, as i have checked in debug log, and they fires 3 to 4 times...and which makes SOQL query increasing
Also the workflows are fire as i checked in debug... what approach should i have to folllow to resolve this problem....
Error is in expression '{!saveclosedwonpage}' in component <apex:commandButton> in page nonapaclosedwonform: Trigger.InvestmentCriteriaUpdate: line 29, column 1
Trigger.InvestmentCriteriaUpdate: line 29, column 1
there are around 11 triggers, as i have checked in debug log, and they fires 3 to 4 times...and which makes SOQL query increasing
Also the workflows are fire as i checked in debug... what approach should i have to folllow to resolve this problem....
Following issue you have in your code:-
1) Always create only one trigger per object as per salesforce best pratice
2) Recursive trigger
Solution 1:- how to stop recursive trigger in salesforce
http://amitsalesforce.blogspot.in/2015/03/how-to-stop-recursive-trigger-in.html
Apex Class with Static Variable
Trigger Code
Solution 2:- Use salesforce frame work
http://amitsalesforce.blogspot.in/2015/06/trigger-best-practices-sample-trigger.html
Create one Trigger "AccountTrigger"
Create one Trigger Handler Class
Create one Trigger Action Class
Please mark this as solution if this will help you. So that is some one has same issue this post can help others
Thanks
Amit Chaudhary