Activity Forums Salesforce® Discussions How to invoke batch apex job programmatically in salesforce?

  • Yogesh

    Member
    September 26, 2019 at 10:04 am

    Hello,

    Run Batch Apex
    1. From the Developer Console, click Debug | then Open Execute Anonymous Window.
    2. Execute the following code.
    Id <variable name>= Database.executeBatch(new <Class name>(), batch size);
    Example code
    Id batchJobId = Database.executeBatch(new RunThisBatch(), 200);
    NOTE: batchJobId will contain the job Id of the batch.

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos