One of the advantages of working on a cloud platform like Salesforce is some really cool and important functions comes inbuilt and only we have to do is setting up those according to your requirements.One such feature is Salesforce History Tracking.
History tracking is the Salesforce way of monitoring and auditing the changes done to data (object records) by the users. In any business monitoring and auditing data changes is important for security and administrative purposes.In this article I am going to discuss how to enable history tracking on a Custom object and how to monitor the changes done by the users to records of history tracking enabled object.
To learn more refer
Salesforce History Tracking
1. Go to the object you want to track history - here my object is
Friend.
2. Click on the
Edit button and scroll down to
Optional Features section and tick following options
- Track Field History
- Allow Reports
3. Now on top of your Custom Field List you can see a new button
Set History Tracking. Click on it and Select the Fields on the object you want monitored. You are only allowed to track maximum of 20 fields so choose wisely :)
Now we are done with Setting up the object for history tracking. This point forward any changes made to the tracking enable fields of the object will be logged by Salesforce. Our next task is to create a report on those logs. so we can view those tracking details.
4. Click on the plus (+) on your tab list .
5. Scroll to Reports link and click on it.
6. Click New Report
7. Then Select the Report Type .This should be "< your object name> History". Since my object is Friend , reporting Type is "Friend History".
- If reporting type is not available please check you have enabled Allow Reports option on your object
- Reporting Type is not created for Detail objects of Master - Detail relationship so please make sure your object (History Tracking enabled) is not a detail object of a master -Detail relationship.
8. Click on Create
Parent ID field appearing in the history records is the Salesforce ID of the actual record to which that history record is related.
9. Customize the report according to your requirements and click on Save
- Give a name to your report
- Select the Folder you want to save the report based on who you want to allow to access the report
Now we are done.
10. Then you can run the report to see the details
11. Optionally you can add History tracking related list to your page layout (just click
related lists and drag and drop
<object Name> History list to your layout and Save the layout).Since it will show the field tracking details to the all the users who has read access to the records it is not the best idea but it depends on your Application's requirement and data sensitivity.
important points to note
- History tracking starts from point you enable history tracking. No changes prior to enabling history tracking won't be available..
- Changes to Fields with more than 255 characters are tracked as Edited. Their old and new values are not recorded.
- Cannot create History report on Custom objects which has master-Detail relationships.
- If you disable history tracking for custom object, you cannot report on its field history.