5

We had scheduled batch jobs through developer console

System.schedule('Job1', '0 * * * * ?', new scheduledMerge());
System.schedule('Job2', '0 15 * * * ?', new scheduledMerge());
System.schedule('Job3', '0 30 * * * ?', new scheduledMerge());
System.schedule('Job4', '0 45 * * * ?', new scheduledMerge());

Now i want to stop these jobs from running every 15 mins. How can i stop these jobs? If i delete the jobs from Monitoring -> scheduled Jobs.

13

Try this Apex code in Developer Console Execute Anonymous.

for (CronTrigger ct : [SELECT Id FROM CronTrigger]) {
    System.abortJob(ct.Id);
}
  • 3
    They may have schedulled jobs they do not wish to stop, did you consider that ? – Samuel De Rycke Jan 30 '14 at 15:08
  • 4
    I think that if they have some they will be able add some conditions to this query :) In fact question was "How do we stop all scheduled batch" – Artur Kępczyński Jan 30 '14 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.