1

Is there any way to alert the Admin user (like sending Email Notification) if any scheduled job is deleted from Scheduled Jobs?

1 Answer 1

2

If you say any direct process then there is no standard process is available, but there is a work around by which i think you can achieve this functionality

  1. create on Batch class and schedule it after you schedule job is .
  2. In that batch class run the below query:

    SELECT Id,JobType,Name FROM CronJobDetail where Name='you scheduled
    job Name'
    
  3. then with the help of Job Id query on CronTrigger

    SELECT CreatedById, CreatedDate, 
    CronExpression, CronJobDetailId, EndTime, Id, NextFireTime,
    PreviousFireTime,StartTime,State,TimesTriggered
    FROM CronTrigger where CronJobDetailId :='your job Id from above query'
    
  4. Now put the logic after that if the job is already deleted you can check this from the query and send email based on the logic.

2
  • @sunny, is it working for u?
    – Avijit Das
    Apr 19, 2017 at 5:10
  • very helpful @avijit
    – Anujit Das
    Apr 19, 2017 at 6:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .