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

  • 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.

  • 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.

Popular Salesforce Blogs

Popular Salesforce Videos