Activity Forums Salesforce® Discussions what is the Use of database.querylocator in Salesforce?

  • Kirandeep

    Member
    January 21, 2020 at 5:25 PM

    Database.getQueryLocator in Salesforce returns a Query Locator that runs your selected SOQL query returning list that can be iterated over in batch apex or used for displaying large sets in VF.

  • Ratnesh

    Member
    January 21, 2020 at 5:36 PM
    • Database.getQueryLocator returns a Query Locator that runs your selected SOQL query returning list that can be iterated over in batch apex.
    • The query locator can return up to 50 million records
    • It should be used in instances where you want to batch a high volume of data up (pagination or batch apex).
    • The database.query method should be used in instances where you are wanting to do a dynamic runtime SOQL query for your code.

Log In to reply.

Popular Salesforce Blogs

Success Stories – How DemandBlue Helped Its Clients Improve Revenue Recognition with Salesforce Revenue Cloud Implementation

Blog in

Businesses that deal with subscription-based contracts, usage-based billing or other complex contracts face several difficulties in managing their billing cycle. Though Salesforce CPQ implementation does the heavy-lifting…

Popular Salesforce Videos