You need to sign in to do that
Don't have an account?

Too many SOQL queries nested loop
Hi,
Im using nested loop for fetching case comments depending on the languages(its a list), To achieve this I have implemented nested Loop.
1st loop fetches all the languages from the custom object and
2nd loop fetches case comments depending on the language.
While im using this "Too many SOQL queries" is firing please suggest me solution.
Just make it somple like below: hope this helps
All Answers
Hope that your day is off to an amazing start. It sounds like you coded the SOQL queries inside the code block of the for loops which is causing you to hit the governor limits. Please modify your code so that it's outside the loops. Hope this helps and may God bless you abundantly.
Best Regards,
Anthony McDougald
Just make it somple like below: hope this helps
Hi Dev-Fox,
I have followed your above code and it helped a lot,
there is one more problem in the, In Second loop SOQL where condition I need to add language condition as weel as case comment parent id. Can i use two IN: conditions for language(where lang_field IN :) and also for comment case ID??