On the object level - does it do a full replace? For example on the Account or custom object.
On identical fields - does it do a full replace or does not deploy or create a duplicate field?
On the object level - does it do a full replace? For example on the Account or custom object.
Deploying CustomObject
metadata will overwrite any corresponding metadata elements in your org, but won't wipe out any customizations that aren't explicitly being deployed. For example, if you deploy a minimal Lead
object, like this, to update its Sharing Model:
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<sharingModel>Private</sharingModel>
</CustomObject>
no other changes would be made to Lead or its existing customizations - but any previously declared sharing model would be replaced with what you deploy.
Likewise custom objects: your new deployment does not "delete and replace" an existing custom object of the same name; it overwrites the specific metadata elements you deploy in the target org and leaves the remainder unchanged.
On identical fields - does it do a full replace or does not deploy or create a duplicate field?
Neither; the behavior is the same as with Custom Objects. The metadata contained in the second deployment overwrites its counterparts in the target org. Any elements you don't include in the second deployment are unchanged.
Note in both cases that Salesforce requires you to include specific elements in the deployments of these metadata entities, so you won't have a choice to omit certain pieces of the entity - like the label
, for example.
Agree with the above, but will also just state it this way: In a deployment operation, you are effectively upserting metadata, and the API name of a component is treated like a primary key. So if you have an object MyObj__c and you deploy an object named MyObj__c then your deployment will update the configuration of the existing object.