You are on page 1of 4

Field History Tracking

You can select certain fields to track and display the field history in the History related list of an object. Field history data is
retained for up to 18 months through your org, and up to 24 months via the API. Field history tracking data doesn’t count
against your Salesforce org’s data storage limits.

REQUIRED EDITIONS

Available in: Salesforce Classic (not available in all orgs), Lightning Experience, and the Salesforce app
Available in: Contact Manager, Essentials, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Edit

Standard Objects aren’t available in Database.com


You can track the field history of custom objects and the following standard objects.

 Accounts
 Articles
 Assets
 Campaigns
 Cases
 Contacts
 Contracts
 Contract Line Items
 Crisis
 Employees
 Employee Crisis Assessments
 Entitlements
 Individuals
 Internal Organization Units
 Knowledge
 Leads
 Opportunities
 Orders
 Order Products
 Products
 Price Book Entries
 Service Appointments
 Service Contracts
 Solutions
 Work Orders
 Work Order Line Items

Modifying any of these fields adds an entry to the History related list. All entries include the date, time, nature of the change, and who
made the change. Not all field types are available for historical trend reporting. Certain changes, such as case escalations, are always
tracked.

Salesforce stores an object’s tracked field history in an associated object called StandardObjectNameHistory


or CustomObjectName__History. For example, AccountHistory represents the history of changes to the values of an Account record’s
fields. Similarly, MyCustomObject__History tracks field history for the MyCustomObject__c custom object.
NOTE Since the Spring ’15 release, increasing the entity field history retention period beyond the standard 18–24 months
requires the purchase of the Field Audit Trail add-on. When the add-on subscription is enabled, your field history retention
period is changed to reflect the retention policy provided with your subscription. If your org was created before June 1, 2011,
Salesforce continues to retain all field history. If your org was created on or after June 1, 2011 and you decide not to purchase
the add-on, Salesforce retains your field history for the standard 18–24 months.
Considerations

Consider the following when working with field history tracking.

General Considerations

 Salesforce starts tracking field history from the date and time that you enable it on a field. Changes made
before this date and time aren’t included and didn’t create an entry in the History related list.
 Use Data Loader or the queryAll() API to retrieve field history that ‘s 18–24 months old.
 Changes to fields with more than 255 characters are tracked as edited, and their old and new values aren’t
recorded.
 Changes to time fields aren’t tracked in the field history related list.
 The Field History Tracking timestamp is precise to a second in time. In other words, if two users update the
same tracked field on the same record in the same second, both updates have the same timestamp. Salesforce
can’t guarantee the commit order of these changes to the database. As a result, the display values can look out
of order.
 You can’t create a record type on a standard or custom object and enable field history tracking on the record
type in the same Metadata API deployment. Instead, create the record type in one deployment and enable
history tracking on it in a separate deployment.
 Salesforce doesn’t enable the recently viewed or referenced functionality in StandardObjectNameHistory
or CustomObjectName__History objects. As a result, you can’t use the FOR VIEW or FOR REFERENCE
clauses in SOQL queries on these history objects. For example, the following SOQL query isn’t valid:

SELECT AccountId, Field FROM AccountHistory LIMIT 1 FOR VIEW


Interactions With Other Salesforce Features

 In Lightning, you can see gaps in numerical order in the Created Date and ID fields. All tracked changes still
are committed and recorded to your audit log. However, the exact time that those changes occur in the
database can vary widely and aren't guaranteed to occur within the same millisecond. For example, there can
be triggers or updates on a field that increase the commit time, and you can see a gap in time. During that time
period, IDs are created in increasing numerical order but can also have gaps for the same reason.
 If Process Builder, an Apex trigger, or a Flow causes a change on an object the current user doesn’t have
permission to edit, that change isn’t tracked. Field history honors the permissions of the current user and
doesn’t record changes that occur in system context.
 Salesforce attempts to track all changes to a history-tracked field, even if a particular change is never stored in
the database. For example, let’s say an admin defines an Apex before trigger on an object that changes a Postal
Code field value of 12345 to 94619. A user adds a record to the object and sets the Postal Code field
to 12345. Because of the Apex trigger, the actual Postal Code value stored in the database is 94619.
Although only one value was eventually stored in the database, the tracked history of the Zip Code field has
two new entries:
o No value --> 12345 (the change made by the user when they inserted the new record)
o 12345 --> 94619 (the change made by the Apex trigger)

Translation and Locale Considerations

 Tracked field values aren’t automatically translated; they display in the language in which they were made. For
example, if a field is changed from Green to Verde, Verde is displayed no matter what a user’s language
is, unless the field value has been translated into other languages via the Translation Workbench. This behavior
also applies to record types and picklist values.
 Changes to custom field labels that have been translated via the Translation Workbench are shown in the locale
of the user viewing the History related list. For example, if a custom field label is Red and translated into
Spanish as Rojo, then a user with a Spanish locale sees the custom field label as Rojo. Otherwise, the user
sees the custom field label as Red.
 Changes to date fields, number fields, and standard fields are shown in the locale of the user viewing the
History related list. For example, a date change to August 5, 2012 shows as 8/5/2012 for a user with
the English (United States) locale, and as 5/8/2012 for a user with the English (United Kingdom) locale.

Track Field History for Standard Objects


You can enable field history tracking for standard objects in the object’s management settings.

REQUIRED EDITIONS AND USER PERMISSIONS

Available in: Salesforce Classic (not available in all orgs), Lightning Experience, and the Salesforce app
Available in: Contact Manager, Essentials, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Edit

Standard Objects are not available in Database.com

USER PERMISSIONS NEEDED


To set up which fields are tracked: Customize Application
If you use both business accounts and person accounts, keep in mind that:

 Field history tracking for accounts applies to both business and person accounts, so the 20-field maximum includes
both types of accounts.
 Changes made directly to a person contact record aren’t tracked by field history.

To set up field history tracking:

1. From the management settings for the object whose field history you want to track, go to the fields area.
2. Click Set History Tracking.

TIP When you enable tracking for an object, customize your page layouts to include the object’s history related list.

3. For accounts, contacts, leads, and opportunities, select the Enable Account History, Enable Contact
History, Enable Lead History, or Enable Opportunity History checkbox.
4. Choose the fields you want tracked.

You can select a combination of up to 20 standard and custom fields per object. For accounts, this limit includes fields
for both business accounts and person accounts..

Certain changes, such as case escalations, are always tracked.

You can’t track the following fields:

 Formula, roll-up summary, or auto-number fields


 Created By and Last Modified By
 Fields that have the AI Prediction checkbox selected
 Expected Revenue field on opportunities
 Master Solution Title or the Master Solution Details fields on solutions; these fields
display only for translated solutions in organizations with multilingual solutions enabled.
5. Click Save.

Salesforce tracks history from this date and time forward. Changes made prior to this date and time are not included.

You might also like