function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sharath-learnerSharath-learner 

System.limitException Too many SOQL queries

Integer repeat=4;
        while(repeat!=0)
        {
            if(repeat==0)
            {
            break;
            }
            else
            {   
            Integer nextCount =[select COUNT() from Account where Batch_Queue__c = true];
             if(nextCount!=0)    
                {
                sendNotification('Account');
                }
            }   
        repeat--;    
        }

 

and send Notification contains only 4 SOQL queries not with in for loops.

But i'm getting this exception...

 

 

Please help

Laxman RaoLaxman Rao

you are calling a method sendNotification('Account'), might be in this method you are exceuting soql queries.

Can you paste the sendNotification('Account') method?

kamlesh_chauhankamlesh_chauhan

provide the code of sendNotification('Account') method and also it looks like you are using trigger to execute above code.

Please confirm.

 

Regards,

 

Kamlesh Chauhan, (Founder & CTO, LogicRain Technologies)

kamlesh@logicrain.com || http://www.logicrain.com || LinkedIn

 

Answers/Suggestions are my own.
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.