I have a scheduled job in my org which was scheduled 2 years ago without an end date. It runs every Friday at a specific time, which means it was scheduled using a cron expression. If I delete that scheduled job directly will it be aborted? Or else should it be aborted with some code?

  • 1
    You can schedule for every Friday at a specific time through the UI. The scheduling pattern you describe by no means indicates a cron expression had to be used. – Adrian Larson Apr 25 '16 at 15:01

Deleting the scheduled job is enough. It will not run again.

You can also delete using code.

for (CronTrigger ct : [SELECT Id FROM CronTrigger WHERE CreatedBy.Name='xxx']) {
  • 1
    Thanks for the reply @sfdcFanBoy....I just wanted to know...if i delete scheduled job directly....it will not create any problem in the future right? – Learner_sfdc Apr 25 '16 at 7:01
  • 2
    @learner_sfdc : No worries - deleting the scheduled job from the UI or code will not cause any issues. – cropredy Apr 25 '16 at 13:34
  • @Learner_sfdc Yes, that won't be a problem! – sfdcFanBoy Apr 25 '16 at 15:18

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.