Delete All Scheduled Jobs in Salesforce Org

Sample Code:

//Get all scheduled jobs
List<CronTrigger> ctList = [SELECT Id, CreatedDate, CronExpression, CronJobDetailId, EndTime,
                            NextFireTime, OwnerId, PreviousFireTime, StartTime, State,
                            TimesTriggered FROM CronTrigger];
//Abort all jobs one by one
for(CronTrigger ct:ctList){
    System.abortJob(ct.Id);
}

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.50 out of 5)
Loading...

About Biswajeet

Biswajeet is my Name, Success is my Aim and Challenge is my Game. Risk & Riding is my Passion and Hard Work is my Occupation. Love is my Friend, Perfection is my Habit and Smartness is my Style. Smiling is my Hobby, Politeness is my Policy and Confidence is my Power.