Just wondering if anyone has tried this and if so how does validation come into play?

I can't find any information or documentation stating whether this is possible or not.


No, You can't delete in production using sfdx force:source:delete.

As per doc, it Deletes source files from your project and from a non-source-tracked org, such as a sandbox.

To delete from production, use destructiveChanges.xml. Follow these articles:-

  1. Deleting Files from an Organization

The package.xml file is a project manifest that lists all the components to retrieve or deploy. Although you can use package.xml to add components, it’s not sufficient to delete them. To delete files, create a delete manifest that’s called destructiveChanges.xml. The format of the delete manifest is the same as package.xml, except that wildcards aren’t supported.

|improve this answer|||||
  • The question was about force:source:delete, not force:org:delete. – Phil W Oct 2 '19 at 7:11
  • Thanks, corrected it now. – sanket kumar Oct 2 '19 at 7:41
  • 1
    Thank you for your response. According to this doc developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/… force:source:deploy can be used to deploy changes to production, is there any corresponding way to delete changes that you know of or does this have to be done via the metadata api? – Bob Laskowski Oct 2 '19 at 12:02

From the forcedotcom/cli repo's issues I have found: https://github.com/forcedotcom/cli/issues/188.

sfdx force:source:deploy -x package.xml does not currently support destructive changes but this feature is planned to be implemented in the coming months.

Currently sfdx force:mdapi:deploy does support destructiveChangesPre/Post.xml to delete files.

|improve this answer|||||

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.