I wrote a batch class and called same batch class from finish method without any time interval, Now I am not able to stop it..
global class SaveFileIntoDropbox implements Database.Batchable<sObject>,Database.AllowsCallouts{
global Database.QueryLocator start(Database.BatchableContext BC) {
string soql = 'select id from ContentVersion';
return Database.getQueryLocator(soql);
}
global void execute(Database.BatchableContext BC, list<sObject> scope) {
....
}
global void finish(Database.BatchableContext BC) {
Database.executeBatch(new SaveFileIntoDropbox(),1);
}
}
Update I already tried:
string a = [Select a.Name, a.Id From ApexClass a where a.Name like 'save%'].id;
List<AsyncApexJob> lstJobs = [SELECT Id FROM AsyncApexJob WHERE ApexClassID=:a and status != 'completed' ];
system.debug(lstJobs.size());
for(AsyncApexJob job : lstJobs) {
try {
System.abortJob(job.Id); //01p0k000001ZyIGAAS
} catch(Exception ex ) {
System.debug(ex);
}
}
System.abortJob
in Developer Console to get rid of it? See this post for some info on how salesforce.stackexchange.com/questions/80714/…