Retrieve Custom/Standard objects with package.xml

How to retrieve salesforce objects with package.xml

Using following syntax we retrieve any Standard or Custom Salesforce objects.

Syntax to retrieve objects:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <name>CustomObject</name>
        <members>Object_API_Name</members>
        <members>Account</members>
        <members>Case</members>
    </types>
    <version>62.0</version>
</Package>

Object metadata definition contains following items:

  • Compact layouts
  • Actions
  • Buttons & Actions
  • Fields Sets
  • Fields details
  • Dependent Fields/ Controlling Fields
  • Record Types
  • Validations Rules

Find how to retrieve apps metadata using package.xml.

Find how to retrieve Utility Bar metadata using package.xml.

Leave a Reply