By Mohit Phogat on Jan 23, 2012
I am posting this article for our benefit that I got to see on PeopleSoft Audit. This talks of how a single audit record can be used to audit multiple PeopleSoft records.
The easiest way to create an audit record is to open the record definition of the base record that you wish to audit. Remove the all edit and key attributes from the newly saved audit record. Also remove any attributes such as PARENT records, Query Security Records, and PeopleCode must be removed for the audit record. The audit record must be saved with the prefix AUDIT_.
To the top of this new audit record the following key fields have to be added in the same order and they should also be made as key fields.
- AUDIT_OPRID - Identifies the user who caused the system to trigger the audits
- AUDIT_STAMP -Identifies the date and time the audit was triggered
- AUDIT_ACTN - Indicates the type of action that the system audited.
- A: Row inserted.
- D: Row deleted.
- C: Row changed (updated), but no key fields changed. The system writes old values to the audit table.
- K: Row changed (updated), and at least one key field changed. The system writes old values to the audit table.
- N: Row changed (updated), and at least one key field changed. The system writes new values to the audit table.
- ** - AUDIT_RECNAME must be added only if the audit table needs to audit more than one record definition.
In the record to be audited go to Record Properties -> Record Audit, specify the below options:
- Record Name – Specify the user-defined audit record.
- Specify the required Audit Options – following are the audit options to choose for auditing the record.
- Add - Inserts an audit table row whenever a new row is added to the table underlying this record definition.
- Change - Inserts one or two audit table rows whenever a row is changed on the table underlying this record definition.
- Selective - Inserts one or two audit table rows whenever a field that is also included in the record definition for the audit table is changed.
- Delete - Inserts an audit table row whenever a row is deleted from the table underlying this record definition.