16

I have a Visual Studio Code project which has beed authorised against a production environment.

I am using the Salesforce DX CLI pre-release:

sfdx plugins:install salesforcedx@pre-release

When I right-click on an Apex class in Visual Studio Code and select:

SFDX: Deploy Source to Org

I get this error message:

ERROR: INVALID_OPERATION: rollbackOnError option must be true on a production org

How do I set rollbackOnError to true in the sfdx-config.json or sfdx-project.json?

Such that it's set correctly when I use the SFDX: Deploy Source to Org command.

3
  • 8
    Looks like a bug/"unintentional feature" of force:source:deploy. I'm asking Wade for his input on the matter. The alternative workaround is force:source:convert followed by force:mdapi:deploy in order to set the necessary flag. I think it might literally be easier to write your own script for now.
    – sfdcfox
    Sep 8, 2018 at 23:10
  • @sfdcfox Any word from Wade?
    – Robs
    Sep 24, 2018 at 18:02
  • 1
    I should circle back. He pinged someone else, and from there it just sort of fizzled out. Being #DF18 week, it might be a bit hard to get an answer though, but please remind me next Monday and I'll double-check.
    – sfdcfox
    Sep 24, 2018 at 18:09

2 Answers 2

5

Sorry feel free to @ mention me here in the future. This is a known limitation that the team is addressing. We'll add these validation capabilities to the force:source:deploy command in the near future. For now, @sfdcfox's workaround is the best approach.

1

we had this issue when we set --ignoreerrors flag. Removed it and no issues any longer (note we use alias flags) Before:
sfdx force:mdapi:deploy -u sfprod-c -d destructiveChangesPre -g -o -w 60 --apiversion '52.0' After: sfdx force:mdapi:deploy -u sfprod-c -d destructiveChangesPre -g -w 60 --apiversion '52.0'

You must log in to answer this question.

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