6

When I edit and try to save an Apex class, I get the following message:

Compile Error: This schedulable class has jobs pending or in progress at line 11 column 8

How can I fix this?

4 Answers 4

4

The reason for this error is because your apex class is used under scheduler class. You need to delete your scheduler job and recreate after the compilation.

Regards. David Lirio

2
  • yes i do that things working fine.. if the class is scheduler class then scheduler job itself create?? Jul 28, 2015 at 14:11
  • Yes, all the scheduler class generate a job after the execution. If you deleted the job, only need run the class and you will have again the job in the scheduler view. Jul 29, 2015 at 6:59
3

To see a list of scheduled apex jobs go to Setup->Monitoring->Scheduled Jobs. This list also includes other scheduled jobs, i.e. dashboard/report freshes and analytic snapshots. You can create a list view to just scheduled Apex. The Apex Jobs monitoring section will only list @future and batch methods.

Source : Ralph Callaway answer

1

i got the solution. we can delete the scheduled job. because it need only run the class . and we can invoke the scheduler class in apex scheduler . that automatically generate the schedule job ..

0

As per Salesforce help article https://help.salesforce.com/s/articleView?id=000323577&type=1 this can also happen "When editing a class being called by a class that is called in the execute() method, in other words, a dependent class." which makes it a lot more difficult to find out the dependent schedulable class / scheduled job.

However, metadata API based deployment https://developer.salesforce.com/docs/atlas.en-us.220.0.api_meta.meta/api_meta/file_based_zip_file.htm is able to work around this problem and make changes to the class.

You must log in to answer this question.

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