Activity Forums Salesforce® Discussions Run Batch Apex class without stopping in Salesforce?

  • Amarkant

    Member
    June 7, 2017 at 3:02 am

    What is you exact scenario ?

    One thing you can do to achieve this, start the next batch in finish method of first batch.

  • HARSHITA

    Member
    June 7, 2017 at 5:52 am

    Hi Amar,
    I was asked this question in an interview and i answered the same.No scenario was provided.

  • Amarkant

    Member
    June 7, 2017 at 6:46 am

    We can have Integer Iterator to achieve this instead of Query Locator in Batch Apex.

  • Shaik

    Member
    June 9, 2017 at 6:39 pm

    invoke the same batch in Finish method.

    global void finish(Database.BatchableContext BC){
    Database.executeBatch(new sampleBatch,1000);
    }

Log In to reply.

Popular Salesforce Blogs