Too many query rows 50001 in batch class

Latest Posts Forums Project Scenarios Lightning Aura Component Too many query rows 50001 in batch class

Tagged: 

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1527 Reply
    Admin
    Keymaster

    Causal queries can be several. One I encountered was when I skipped to use query locator in my batch apex.

    Represents the record set returned by Database.getQueryLocator and used with Batch Apex.

    Using string query was giving error though using ‘Database.QueryLocator’ and returning that as below solved the error.

    public Database.QueryLocator start(Database.BatchableContext bc){
    string accon = ‘Select ID,Name,(Select Id,Company__c FROM CONTACTS) From Account’;
    return Database.getQueryLocator(accon);

Viewing 1 post (of 1 total)
Reply To: Reply #1527 in Too many query rows 50001 in batch class
Your information: