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
etechcareersetechcareers 

System.LimitException: Too many query rows: 725 stacktrace???? HELPPPPP

Hi:

   What is this error:

System.LimitException: Too
many query rows: 725 stacktrace

What is wrong with my method here... this is where I am getting the error.

 

 

public List<Opportunity> getOpportunities(){
      
        opportunities = [Select o.name, o.CloseDate, 
            (Select x_CC__c From cv__R00N40000001X8re__r) 
        FROM Opportunity o 
        WHERE x_Date__c = NULL 
        AND StageName = 'Received' ORDER BY CloseDate];

      return opportunities;
    }

 

 

paul-lmipaul-lmi

Is this in a trigger, or outside a trigger?  Also, I highly recommend not using = null in a WHERE clause.  It won't scale, and the performance degrades significantly as the size of your opps object grows (the platform can't optimize on queries like that, so it uses more resources).

etechcareersetechcareers

Thanks it is a apex class trigger by a button or VF page...

But if I do not use NULL

what would be another version of NULL is it better to use x_Date__c="" or LEN(x_Date__c)=0 ????

paul-lmipaul-lmi

i can't make a recommendation there, but I can say that writing queries based on null isn't recommended.  if you absolutely have to, you do, but just warning you.