3

The deployment settings (Setup > Deploy > Deployment Settings) contain a Boolean "Allow deployments of components when corresponding Apex jobs are pending or in progress" which defaults to false.

This is fine as long as there are no Apex jobs, but once there are you need to set this true otherwise further deployments fail if they touch anything related to those jobs.

Is there a way to set this boolean true when creating a scratch org or, if not, via an existing SFDX command?

4

Actually there are DeploymentSettings that are responsible for that and can be configured in project-scratch-def.json file:

{
  "orgName": "Scratch", 
  "edition": "Developer",
  "features": [],
  "settings": {
      "deploymentSettings": {
        "doesSkipAsyncApexValidation": true
      }
  }
}

Also "Allow deployments of components when corresponding Apex jobs are pending or in progress" option is configured in <force-app>/main/default/settings/Deployment.settings-meta.xml medatata file:

<?xml version="1.0" encoding="UTF-8"?>
<DeploymentSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <doesSkipAsyncApexValidation>true</doesSkipAsyncApexValidation>
</DeploymentSettings>
| improve this answer | |
  • 1
    Thanks Oleh! Using what you posted I was able to find this by changing my internet search terms. The documentation is very convoluted around what you can define in the scratch def, relying on a spider web of links to bamboozle folks like me :( – Phil W Sep 22 at 10:49
  • You're welcome, Phil. Agree with you about the documentation and also I'm not happy that sfdx is still full of bugs and unresolved known issues. – Oleh Berehovskyi Sep 22 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.