function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Saurabh DhobleSaurabh Dhoble 

ANT deployment issue - how do I overwrite objects

I'm trying to setup automated salesforce deployment for our project, using ANT & the salesforce migration tool.Problem is, when I deploy custom objects, it doesn't seem to be overwriting the fields.

For e.g., if I have a field "Overview" on a custom object, and I remove it from the XML file definition, the ANT deployment somehow leaves the field on the object in salesforce after deployment.

 

I tried putting in the destructiveChanges.xml file which works, but I cannot put each and every field that we are changing into the destructiveChanges file. I'm hoping that there is a better way to do this.

 

Any help is appreciated.

sfdcfoxsfdcfox

The ANT toolkit is based on the metadata toolkit, which is roughly analogous to an XML-formatted ALTER TABLE query in SQL. Like ALTER TABLE, it only modifies specified data elements (fields, objects, etc). So, if the field can be changed to the new data type (e.g. Phone to Text), you can simply specify this in the object's XML. If the change isn't a legal change, you have to delete the field first via destructiveChanges.xml. There's no other workaround for this at the moment.

Ilan HazanIlan Hazan

Hello,
I am having the same problem now at 2018.

Is there a way to deploy to server in a way it overrite metadata content and not merge it?