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
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
The following sample destructiveChanges.xml file names a single custom object to be deleted:
1 | <? xml version = "1.0" encoding = "UTF-8" ?> |
2 | < Package xmlns = "http://soap.sforce.com/2006/04/metadata" > |
3 | < types > |
4 | < members >MyCustomObject__c</ members > |
5 | < name >CustomObject</ name > |
6 | </ types > |
7 | </ Package > |
To deploy the destructive changes, you must also have a package.xml file that lists no components to deploy, includes the API version, and is in the same directory as destructiveChanges.xml:
1 | <? xml version = "1.0" encoding = "UTF-8" ?> |
2 | < Package xmlns = "http://soap.sforce.com/2006/04/metadata" > |
3 | < version >38.0</ version > |
4 | </ Package > |