4

I'm trying to figure out how to retrieve Field Audit Trail metadata using the WorkBench, and I'm stumped. I used the WorkBench to deploy a zip file named package-Dev.zip, which contained the following files:

1) A file named Account.object:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
   <historyRetentionPolicy>
       <archiveAfterMonths>14</archiveAfterMonths>
       <archiveRetentionYears>10</archiveRetentionYears>
       <description>Account object field history retention policy -- Dev</description>
       <gracePeriodDays>0</gracePeriodDays>
   </historyRetentionPolicy>
   <fields>
       <fullName>BillingAddress</fullName>
       <fullName>City_Mailing_Address_Group__c</fullName>
   </fields>
</CustomObject>

2) A file named package.xml:

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

Now I want to use the WorkBench to retrieve the metadata (history retention policy and fields) that I deployed for the account object via package-Dev.zip. What's the XML code that I need to use to retrieve that metadata? I'm not an XML or API programmer, and all of the examples I've found seem to assume that I know more than I do, so I'm lost.

2

On the top level menu click 'migration' and select the 'retrieve' option. The XML you'll need will be similar to the one used to deploy. Notice I'm using api version 36.

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

You can find more info about this here https://developer.salesforce.com/docs/atlas.en-us.field_history_retention.meta/field_history_retention/field_audit_trail.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.