Force Save gives error on a schedulable class

Issue #2231 duplicate
Jens Henrik Rauff Hansen created an issue

When using “Force Save” to deploy a class that is used in a schedulable, I get the error:

ERROR deploying ApexClass classes/TheClassName.cls: This schedulable class has jobs pending or in progress

When using SFDX to deploy, this error does not occur.

Organization type is “OAuth” with subsettings on false.

Is a setting missing where i can override this, if its not an error?

Comments (3)

  1. Scott Wells repo owner

    Yes, this is a bug in the Salesforce Tooling API where deployment of a class that implements Schedulable cannot be deployed successfully while there are active jobs against that class. The Metadata API does something to allow this, but the Tooling API evidently does not. I’ll see if I can divert what would be Tooling API-based deployments that might encounter this issue to the Metadata API automatically.

  2. Scott Wells repo owner

    Merging into #1066. I’ve just committed a fix for this week’s build. Note that the workaround in the interim is to disable Tooling API-based deployment of Apex. Sorry I didn’t mention that earlier.

  3. Log in to comment