Skip to main content
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.

 

Thanks for your help!

 
11 件の回答
  1. 9月11日 16:39

    If anyone sees this, then according to the documentation:

    https://developer.salesforce.com/docs/atlas.en-us.field_history_retention.meta/field_history_retention/field_audit_trail.htm

     

    Salesforce doesn’t include the default retention policy when you retrieve the object’s definition through Metadata API.  

    Salesforce retrieves only custom retention policies with the object definition.

     

    You might need to change the retention policies from their default value (18 months, 10 years etc.)

0/9000