Compile Error: This schedulable class has jobs pending or in progress workaround
The reason for this error is because your apex class is used or refernced under scheduler class. If you faced this error while developin in Apex I have simple solution that doent’t even require stopping already running jobs. I use Webstorm + Illuminated Cloud 2 in my work so workaround would be for Webstorm, but I think it could be configured in VS Code and in other IDEs as well.
There will be 2 steps
- Open your org Setup as an Admin user -> Deployment Settings -> Check the ‘Allow deployments of components when corresponding Apex jobs are pending or in progress.’
- Open Webstorm -> Configure Illuminated Cloud 2 (Gear on the toolbar) -> Configure Application
Open Validation and Deployment tab and uncheck an Apex checkbox under a Prefer Tooling API for section
And that it, now your class can be deployed in parallel with scheduled job running.