Activity Forums Salesforce® Discussions What is the difference between query Locator and Iterable in Salesforce Batch Apex?

  • PRANAV

    Member
    February 12, 2018 at 11:57 am

    Hi Ankit,

    It depends on your need , if you want to run batch on records that can be filtered by SOQL then QueryLocator is preferable, but if records that you want to bee processed by batch can not be filtered by SOQL then you will have to use iteratable. But most of the cases it will be achieved  by query locator , so query locator is preferable so just try with it if you scope is complex and can not be achieved by SOQL then go with iterable.

    Hope this helps you.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos