Specifying Named Components

The Ant Migration Tool is retired with Spring ’24. The tool continues to function as-is for future API versions but isn’t updated with new functionality and isn’t supported.  If Salesforce adds a new feature that is incompatible with Ant, the Ant Migration Tool won’t be updated to support it. To manage metadata changes, switch to Salesforce CLI for a modern, supported developer experience.

To retrieve a component, specify the type of component in the <name> element and declare each component to be retrieved or deployed in the <members> element. The following is a sample package.xml project manifest that names two custom objects to be retrieved or deployed:

Some metadata components are sub-components of another component. This means you must dot-qualify the sub-component with the parent component name.

The following metadata components are defined as part of an object:

  • CustomField
  • Picklist
  • RecordType
  • Weblink
  • ValidationRule

For example, the following code retrieves a validation rule called ValidationRuleName on the Opportunity object: