• #25225
    Salesforce | Ankit Ankit #13
    Forcetalks

    Difference between database.query() and database.getQueryLocator() in Salesforce?

    Difference between database.query() and database.getQueryLocator() in Salesforce?

    Tagged: , , , , ,

    #25227
    Salesforce | PRANAV PRANAV #1
    Forcetalks

    Hi Ankit,

    database.query allows you to make a dynamic SOQL query at runtime. You can build up a string and then use that as a query string at run time in the database.query statement to make a SOQL call that is determined at run time.
    database.getQueryLocator 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 (allowing things such as pagination).

    Hope this helps you.

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2018 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?