You need to sign in to do that
Don't have an account?
Adarsh Nandan
Getting a Too many Soql Error Exception In Production
I am getting a too many Soql queries Exception in production but not in sandbox . Then what can i do ? its too emegency .
As an always System.LimitException: Too many SOQL queries: 101 is hard to find. An error does not return you at what place is the problem but those that cause SOQL number 101. So you have to investigate ALL code around this action.
May I suggest you please remove the SOQL queries and DML queries if you have written in the for loop.Writing the above queries in for loop will hit the governor limits due to which the above error is caused.
Hope this helps.
Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Thanks,
Nagendra
https://developer.salesforce.com/page/Apex_Code_Best_Practices
Don't use (SeeAlldata=true) in test class
But as you mentioned it is working in sandbox but not in production - It seems that you have inner query.
There is limit for inner query too. Can you share your query so that I can give my inputs.
Check if you are writting query inside for loop. Also If you have multiple triggers for one object you should write only one trigger for one object.
Thanks,
Sukanya Banekar