1

How can I modify a batch class that is already placed in a schedule. I have deleted the Scheduled job and still getting error to modify the corresponding batch class. Can someone please help me here?

Compile error: This Apex class has batch or future jobs pending or in progress; This schedulable class has jobs pending or in progress

1

2 Answers 2

1

Please try this code on your developer console.

list<string> ids = new list<string>();
list<CronJobDetail> cjds = [select id from CronJobDetail];

for(CronJobDetail cjd : cjds){

    ids.add(cjd.id);

}
list<CronTrigger> Cts = [select id from CronTrigger where CronJobDetailId IN :ids];
for(cronTrigger ct: Cts){
    system.abortJob(Ct.id);
} 
1
  • this will abort every job
    – cropredy
    Mar 28, 2016 at 4:12
1

Please remove scheduled batch job manually if you are trying to modified it, then you can continue to modify it.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .