Activity Forums Salesforce® Discussions What is the use of getQuery() method of QueryLocator Class in Salesforce?

  • What is the use of getQuery() method of QueryLocator Class in Salesforce?

    Posted by Kirandeep on May 22, 2020 at 12:46 PM

    What is the use of getQuery() method of QueryLocator Class in Salesforce?

    Ayush replied 6 years ago 4 Members · 3 Replies
  • 3 Replies
  • Shweta

    Member
    May 22, 2020 at 1:39 PM

    getQuery(): It is used to instantiate the Database.QueryLocator object. This is useful when testing the start method and the start method automatically locks the set of records in the batch.

  • [adinserter block='9']
  • Marziya

    Member
    May 22, 2020 at 1:43 PM

    QueryLocator object when you are using a simple query (SELECT) to generate the scope of objects used in the batch job. If you use a querylocator object, the governor limit for the total number of records retrieved by SOQL queries is bypassed but we can retrieve up to 10,000 records.

  • Ayush

    Member
    May 26, 2020 at 7:46 AM

    This is useful when testing the start method and the start method automatically locks the set of records in the batch. It is used to instantiate the Database.QueryLocator object

Log In to reply.