function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SNSNSNSN 

Question Regarding Schedulers

I have 10 batch apex classes (which have related scheduler classes). The first class is triggered using the external web services and after executing the first batch, it schedules the second one after 2 minutes. In this way all the batch classes completes successfully.

The  issue is that all the batch process schedules , Executes and completes successfully but the 4th batch process  scheduler after scheduling  4th  batch apex is not automatically removed from the scheduler jobs(though it runs successfully and schedules the 5th batch). I used the “System.abortJobid” command also in the scheduler class, the command gets executed but there is no effect. Next day when we trigger the first batch again the 4th  batch which is not removed from scheduler jobs is throwing an error that” The batch is already scheduled for execution” .

 

Is there any other solution for this?

 

sherodsherod

You aren't having some weird interaction because of the limit on scheduling 5 batch jobs at a time?

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm