Quick win 17. Feed tracking Vs. History tracking in Salesforce

Itsmem0h1t
3 min readAug 21, 2022

Tracking changes over fields is one of the common asks your business asks you for, right ?

Salesforce has 2 standard / declarative options to track changes to fields over records, but there is a limit to the total number of fields you can enable under both options (which is 20 fields same for both)

Chatter Feed tracking:

This option allows you to show updates over field changes in the chatter feed of the record. This helps mainly in the collaboration between teams and to see what has been changed over the record over time.

The way it works is, once the selected fields are enabled in the feed tracking, SF detects the changes over record fields and updates them in the record feed

Technically, Feed Tracking is stored in an object, end with suffix Feed (for a Standard object) or __Feed (for a Custom object) and records created by feed tracking will have API Type = TrackedChange

You can query the FeedItem object (with API version 23.0 or later) using below: SELECT Id, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Type, Parent.Name, Body, (SELECT ID, FieldName, OldValue, NewValue FROM FeedTrackedChanges ORDER BY ID DESC) FROM FeedItem WHERE CreatedDate > THIS_MONTH ORDER BY CreatedDate DESC

You can see FeedTrackedChange is linked to the FeedItem object (using FeedItemId field) and use to store field name, old and new value. FeedTrackedChange object starts with prefix 0D6 and FeedItem start with prefix 0D5.

Some of the features are

  1. You can configure up to 20 fields to be shown in record chatter feed
  2. You need to “enable feed tracking” in the setup for the object specifically
  3. Tracked feed updates that are older than 45 days delete automatically
  4. With this option, you don’t have history object created but you can query the updates shared in feed by querying feeditem and feedtracked change objects
  5. You can use this object for custom as well standard objects (account, case contact, lead and any custom etc.)
  6. Field history tracking isn’t available for external objects.

Field History tracking :

Remember this option is different from chatter feed tracking, normally people confuse the together. This option allows you to track changes over record fields in a history object. And the tracked changes can be viewed on record detail page in history related list.

This feature can be enabled in the “field history tracking” on the object under fields and relationships section and once enabled the standard “history” object is created for the given object.

Noted features

  1. The field history data is retained for up to 18 months.
  2. You can query the standard history object directly to do any processing or reporting on tracked changes.
  3. Record end with prefix History (for a Standard object) or __History (for a Custom object)

Lastly to mention, In some cases there is need to maintain the field history data for up to “10 years”, independent of field history tracking. The solution is the Field Audit Trail which is an add on you need to purchase with an additional cost that let’s you retain field history data for longer.

This feature allows to you stay comply with industry regulations in regards to audit & data retention. But this feature is not enabled by default, hence contact SF support for this.

References :

feed tracking :https://help.salesforce.com/s/articleView?id=sf.collab_feed_tracking_overview.htm&type=5

That’s all for this topic, Cheers Mohit

--

--