Highlighted
Outstanding Contributor.
Outstanding Contributor.
69 views

(SM) Support Tip: How to enable audit functionality for deleted records

How to enable audit functionality for deleted records

Out of the box Service Manager Auditing functionalities do not audit deleted records because the original code bases the decision of creating an audit record comparing the old record on memory against the new record and because both records are the same by the time users delete the record, no audit record is created.

In order to add this functionality to SM, please follow these steps (Note: This process is required for each table that requires delete auditing)

1- Confirm Audit Specifications exist for the table delete audit is required. Go to System Navigator > Tailoring > Audit > Audit Specifications.

2- Search for the table name under filename to confirm fields are set for audit. If not, add the required values into Filename, Unique Fields, Field Name to Audits and Alias (Label for Users).

3- Once Audit Specifications exist, create a master format control for the table that requires audit. If it exist, please use existent format control.

4- Under the master format control record, go under Javascript section.

5- Look for an empty line and set delete condition to true (or any required condition) and use the following javascript code:

vars.$fempty=new SCFile("tablename");     ---- Replace tablename for the name of the table to audit

6- Now go under subroutines section, look for an empty line and set delete condition to true (or any required condition). In application field add: audit.compare

For names field add:

file

second.file

For values field add:

$file

$fempty

7- Now save changes.

8- Finally confirm when users access any form that uses master format control and they delete the record an audit record is created for the action.

Good luck!

SM Support Engineer

Thank you for using the Micro Focus Community. If you find that this or any post resolves your issue, please be sure to mark it as an "accept as solution".
Labels (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.