Issue
Field-level auditing does not track changes during the execution of a custom process.
Symptoms and Impact
-
Changes to properties configured for field-level auditing are not tracked in the Field History.
-
Audit tab and Field History View display duplicate field-level auditing entries.
Steps to reproduce
-
Open Case Designer and go to Settings Tab > Auditing.
-
Configure field-level auditing for one or more properties on a case type.
-
Execute a custom process that updates a property tracked using the field-level auditing configuration.
-
Audit tab and Field History View will either display duplicate entries, or exclude some tracked field audits.
Root Cause
The product is working as designed.
The application is designed to make use of pxUpdateDateTime to determine if a work object has been updated or not. The field-level auditing functionality uses pxUpdateDateTime to distinguish between the existing work object data and the updated work object data. When the work object has not been updated, field-level auditing treats the scenario as if a new work object is being saved.
Scenarios that cause the symptoms:
-
Case data is saved directly using the Obj-Save activity method. Field-level auditing relies on a series of properties being modified, which the Obj-Save activity method is not designed to set automatically.
-
The properties are updated within a Data Flow. Declarative rules are not supported within Data Flows, and field-level auditing uses declarative rules to detect changes and to add history details.
Solution
Use the below best practices:
-
Replace Obj-Save with the out-of-the-box RecalculateAndSave activity when saving a case in a custom process. This activity will ensure that all expected system properties are set at the time of the save.
-
Do not use Data Flows to update properties if the updates need to be tracked using field-level auditing.
The product documentation for enabling field-level auditing has been updated to mention that field-level auditing will not work when executed from Data Flows due to the fact that declarative rules are not supported within data flows.
An enhancement request has been raised to add support for field-level auditing within Data Flows, but it has not yet been assigned to a specific release.