function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shekhar 13Shekhar 13 

track formulae field in salesforce

Hello All,

How can we track formulae fields in salesforce lightining .
PriyaPriya (Salesforce Developers) 

Hi Shekhar,

Field History Tracking cannot be set on Formula fields as per Standard functionality. However, this can be worked around by creating a custom field, tracking that one, and make sure it's updating it with a workflow rule to retain the same values as the Formula field.

 

Please follow the below steps:

1. Create a Custom field with the Formula field's Data type. More info on how to Create Custom Fields.

2. Create a Workflow Rule to populate the Custom field with the value of the Formula field:

In Classic:

a) Click Setup | Create | Workflow & Approvals | Workflow Rules | New Rule and select the Object
b) Evaluation Criteria: Created, and every time it's edited.
c) Select Rule Criteria per the Business Requirement (Example: Formula Evaluates:TRUE)


In Lightning Experience:

a) Click the Gear icon | Click Setup | Process Automation | Workflow Actions | Workflow Rules | New Rule and select the Object
b) Evaluation Criteria: Created, and every time it's edited.
c) Select Rule Criteria per the Business Requirement (Example: Formula Evaluates:TRUE)
       
3. Workflow Action: Field Update:

       a) Field to Update: Select New Custom Field.
       b) Specify New Field Value: Use a formula to set the new value.
             Insert: Required Formula field ( which you would like to set as Field History Tracking )
       c) Click Save.       
       
4. From the Management Settings for the object, click Set History Tracking and check the Custom Field to track.

In Classic:

From the Fields Settings for the object, click Set History Tracking and check the Custom Field to track.  


In Lightning Experience:

From the Fields & Relationships Settings for the object, click Set History Tracking and check the Custom Field to track. 

Note:  Field History Tracking supports 20 fields per object out of the box. With Field Audit Trail (FAT) add-on, customers can also increase the number of tracked fields to 60. If the customer already has FAT and/or Shield and needs to track even more than 60 fields, there is a possibility up to 100 fields per object using this SKU is available upon request and approval from PM.

 

Kindly mark it as best answer so that it can helps others too.

Regards,

Priya Ranjan