You need to sign in to do that
Don't have an account?
Radical_arjo
System.abortJob(sc.getTriggerId()) is not working
Hi All,
I am trying to abort a scheduled job using System.abort() method. I am using getTriggerId() to get the id of the scheduled job. The line gets executed without any errors and i ahve confirmed the same in debug logs. However the job is not getting aborted. This functionality was working a few days back, but currently stopped working it seems.
Can anyone provide any help on this????
Use System.abortJob Method. this must be work
Like your code is:
global void execute(SchedulableContext sc){}
you can get and track your scheduler method using SchedulableContext variable.
use: System.abortJob(sc.getTriggerId());
Please try this approch..if it is not working then pase your code on discusion ..we will try to give the possible approch.
I have used the abortJob function... Sorry for the typo in my previous post. I have checked the debug logs and i can see the code hitting the abortjob function. However the scheduled job still remains in the queue.
The abortJob method is working fine in other parts of the code...
Thanks for your help
I had this problem when I got my girlfriend pregnant.
Seriously though, that is so strange. Are you absolutely sure that it is not cancelled? Check the return value of the sc.getTriggerId() method... Run SOQL [Select Id, NextFireTime, State FROM CronTrigger WHERE Id = yourcrontriggerid]? Is it actually cancelled? Does the same thing happen if there are no other CronTriggers?
Hi Blobo,
I am pretty sure that it is not getting deleted and my girlfriend is not pregnent... :).
I am suspecting that is there are any update statements before the system.abortJob() , it does not work, any other inputs are welcome.