官术网_书友最值得收藏!

Field history tracking

After answering the question Who sees what?, now we are going to answer the question, Who did what?

With field history tracking, we know which user changed which field on a given record. This information is displayed on the history list (that we should add to each page layout that we are using):

Field History list on the Account object

History data is retained for up to 18 months if we access a record through a browser or 24 months for a record accessed via API (for example, Data Loader, Workbench, or any other tool) by querying the ObjectHistory object (for example, AccountHistory, or CustomObject__History for custom objects).

Here is an example of the SOQL query that delivers the same result as the Account History list of the previous example:

Select CreatedBy.Name, CreatedDate, Field,OldValue, NewValue from AccountHistory Where AccountId = '0011i000007K2LEAA0' Order By CreatedDate DESC

This leads to the following:

Organizations created before June 1, 2011 have perpetual login history retention.

There are a few limitations regarding field history tracking:

  • The old value is not tracked for text fields with more than 255 characters.
  • Old/new values are not automatically translated—that is, if you have a Pizza Type picklist whose value is changed by an Italian user to Al Salame, it won't display as Pepperoni for an English-speaking user (all translations referred to here are made with the Translation Workbench; for more information, refer to Salesforce Support at https://help.salesforce.com/articleView?id=workbench_overview.htm&type=5).
  • The field's label is always translated into the current user's language (for example, Pizza Type will be shown to an Italian user as Tipo di pizza).
  • Date, date/time, and number fields are always displayed with the viewing user's locale.
  • If an Apex trigger causes a change in a field that the current user doesn't have access to, the change is not tracked. Field history always follows field-level security settings.
  • Time fields aren't tracked in the field history list.

To enable field tracking, jump to Setup | Object Manager | ObjectType | Fields & Relationships and click the Set History Tracking button:

Field History tracking configuration
Salesforce Shield (available with additional licensing costs) delivers the Field Audit Trail feature, which increases the number of fields tracked and the time they are retained. You can even define customized retention policies to align with legal and administrative regulations, such as the GDPR for the EU, PIPAs for Canada, or APPI for Japan (more information can be found at https://help.salesforce.com/articleView?id=field_audit_trail.htm&type=5).
主站蜘蛛池模板: 天台县| 清流县| 乐安县| 巴林左旗| 南涧| 武乡县| 安义县| 包头市| 郎溪县| 乐陵市| 壤塘县| 青海省| 铜梁县| 遂川县| 济源市| 历史| 博乐市| 洪湖市| 太原市| 南康市| 察哈| 喜德县| 农安县| 荔波县| 壤塘县| 新民市| 连州市| 于田县| 蒙山县| SHOW| 巫山县| 潼关县| 乌兰察布市| 大厂| 长乐市| 涪陵区| 临潭县| 姜堰市| 宜春市| 昭通市| 斗六市|