Activity Forums Salesforce® Discussions How to suspend a batch job?

  • Ajit

    Member
    April 25, 2016 at 7:25 am

    Hi Hazel

    There are two ways that you can suspend a batch job.

    1. go to setup > Search apex jobs and click abort on the desired batch job

    2.

    for(CronTrigger ct : [SELECT Id, CronJobDetail.Name, CronJobDetail.JobType
    FROM CronTrigger
    WHERE CronJobDetail.Name like 'Work Order%']){

    // abort the job, try/catch because the job might not exist
    // if it's being aborted manually or from another execution
    try{
    system.abortJob(ct.id);
    } catch (exception e) {}
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos