Newer Version Available

This content describes an older version of this product. View Latest

Field Audit Trail

Field Audit Trail lets you define a policy to retain archived field history data up to 10 years from the time the data was archived. This feature helps you comply with industry regulations related to audit capability and data retention.
Available in: Salesforce Classic (not available in all orgs), Lightning Experience, and the Salesforce mobile app
Available in: Enterprise, Performance, and Unlimited Editions

User Permissions Needed
To specify a field history retention policy: Retain Field History

Use Salesforce Metadata API to define a retention policy for your field history for fields that have field history tracking enabled. Then use REST API, SOAP API, and Tooling API to work with your archived data. For information about enabling Field Audit Trail, contact your Salesforce representative.

Field history is copied from the History related list into the FieldHistoryArchive big object. You define one HistoryRetentionPolicy for your related history lists, such as Account History, to specify Field Audit Trail retention policies for the objects you want to archive. Then use Metadata API to deploy the big object. You can update the retention policy on an object as often as you like. With Field Audit Trail, you can track up to 60 fields per object. Without it, you can track only 20 fields per object. With Field Audit Trail, you retain archived field history data up to 10 years from the time the data was archived. Without it, you retain archived data for only 18 months.

Field history tracking data and Field Audit Trail data don’t count against your Salesforce org’s data storage limits.

Important

You can set field history retention policies on these objects.
  • Accounts, including Person Accounts
  • Assets
  • Campaigns
  • Cases
  • Contacts
  • Contracts
  • Contract Line Items
  • Crisis
  • Employee
  • Employee Crisis Assessment
  • Entitlements
  • Individuals
  • Internal Organization Unit
  • Leads
  • Opportunities
  • Orders
  • Order Products
  • Price Books
  • Price Book Entries
  • Products
  • Service Appointments
  • Service Contracts
  • Solutions
  • Work Orders
  • Work Order Line Items
  • Custom objects with field history tracking enabled

Once Field Audit Trail is enabled, HistoryRetentionPolicy is automatically set on the supported objects. By default, data is archived after 18 months in a production organization, after one month in a sandbox organization, and all archived data is stored for 10 years. The default retention policy is not included when retrieving the object’s definition through the Metadata API. Only custom retention policies are retrieved along with the object definition.

Note

You can include field history retention policies in managed and unmanaged packages.

The following fields can’t be tracked.
  • Formula, roll-up summary, or auto-number fields
  • Created By and Last Modified By
  • Expected Revenue field on opportunities
  • Master Solution Title or the Master Solution Details fields on solutions
  • Long text fields
  • Multi-select fields

After you define and deploy a Field Audit Trail policy, production data is migrated from related history lists such as Account History into the FieldHistoryArchive big object. The first copy writes the field history that’s defined by your policy to archive storage and sometimes takes a long time. Subsequent copies transfer only the changes since the last copy and are much faster. A bounded set of SOQL is available to query your archived data. If you delete a record in your production data, the delete cascades to the associated history tracking records, but the history copied into the FieldHistoryArchive big object isn’t deleted. To delete data in FieldHistoryArchive, see Delete Field History and Field Audit Trail Data.

Use Async SOQL to build aggregate reports from a custom object based on the volume of the data in the FieldHistoryArchive big object.

If you enable Platform Encryption in your org and use Field Audit Trail to track encrypted fields, there are limitations on using Async SOQL. In particular, using Async SOQL to query the NewValue or OldValue fields of the FieldHistoryArchive big object is not supported. Use SOQL to query both encrypted and unencrypted NewValue and OldValue fields of FieldHistoryArchive.

Important

Previously archived data remains unencrypted if you turn on Platform Encryption later. For example, your organization uses Field Audit Trail to define a data history retention policy for an account field, such as the phone number field. After enabling Platform Encryption, you turn on encryption for that field, and phone number data in the account is encrypted. New phone number records and previous updates stored in the Account History related list are encrypted. However, phone number history data that is already archived in the FieldHistoryArchive object remains stored without encryption. If your organization wants to encrypt previously archived data, contact Salesforce. We encrypt and rearchive the stored field history data, then delete the unencrypted archive.

Tip