Activity Forums Salesforce® Discussions i want to count how many times execute method executed in Batch class?

  • Manpreet

    Member
    April 27, 2017 at 1:40 pm

    Hi Saurabh,

    Hi,

    the start method excutes once, at the begining.

    For the execute method, it depends on you.

    You can launch it through an Apex command :

    Database.executeBatch(new nameOfYourBatchClass(optionalParamInConstructor), 1);

    Here, the second param in the executeBatch method (the value 1) is the scope ; it means you want the batch to handle the elements 1 by 1.
    For instance, if the batch has to deal with 10 elements, the execute method will executes 10 times.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos