[SalesForce] Modify batch class already in schedule

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

Best Answer

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);
}