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
Madhav GoyalMadhav Goyal 

Abort Scheduled Job does not abort the job immediately?

Hi,

Scenario: There's one picklist (Every 1 hour, Every 2 hours, and so on to Every 24 Hours) , two bottons(Start Job and Abort Job) in Lightning Component.
When Start Job botton is clicked, the schedule job starts, the job is scheduled based on the value of picklist.
And when Abort Job Botton is clicked, the schedule job aborts. 

I have done this and it is working good, but the issue arises, if i schedule job say to "Every 24 hours"(ie. now its 12-09-2017 10:30:00 .So, the next schedule time of the job will be 13-09-2017 10:30:00) and then abort the job and again schedule it to "Every 1 hour"(ie., now its 12-09-2017 10:40:00. So, the next schedule time of the job will be 12-09-2017 11:40:00), I queried and checked, it shows the next scheduled time to 13-09-2017 10:30:00 although i have abort that job, and next scheduled time should be 12-09-2017 11:30:00.

I read somewhere that salesforce do not abort the job immediately, it takes some time to abort the job.

Please help me out to resolve the issue, to immediately abort the scheduled job on button click and start the new scheduled job.

Thanks in advance
Madhav G.