Activity Forums Salesforce® Discussions How to Invoke Batch Class in Salesforce?

  • Piyush

    Member
    August 8, 2019 at 10:18 am

    Hi Achintya,

    We can use database.executebatch ( ) method to programmatically begin the batch job.

    Syntax:

    Public static ID execute batch ( sObject class name)

    Public static ID execute batch (sObject class name, integers scope)

    The above two methods are static methods of database class. We can use any one of the methods to execute the batch job.

  • Saddam

    Member
    August 9, 2019 at 6:01 am

    1) Go to Setup --> Open Developer Console.
    2) Select "Debug" tab --> Open Execute Anonymous Window
    3) In this window, type Database.executeBatch(new NameofBatchClass());

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos