• Ranjith Kumar 229
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,  
We have a Schedule job which is running for every 5 minutes. And Sometimes the job is being stopped unexpectedly, the entire functionality depends on this job only. So i want to know what are the causes for the Schedule job being stopped.

Please help me on this.

Thank you.

I have an Scheduler class witch invokes a batch class, my scheduler invokes System.abortJob to stop it is own execution, but most of these scheduled jobs still remain in Scheduled Jobs list.

 

Here is my scheduler class.

 

global class MyScheduler implements Schedulable {
   
   public Set<Id> olisIds {get; set;}
   
   global void execute(SchedulableContext ctx) {
		MyBatch batch = new MyBatch();
		batch.listOfIds = olisIds;
		Database.executeBatch(batch,100);
		System.abortJob(ctx.getTriggerId());
   }
   
}

The System methods documentation says the following about abortJob method:

Stops the specified job. The stopped job is still visible in the job queue in the Salesforce user interface.

 

But the accumulation of those scheduled jobs are causing an error and I am having to exclude them via interface.

 

Can anyone help me with it?

 

Thanks in advance.