Formatting data

Use the following extension to format AuditTrail data:
sub atCust_CreateLogEntry {
    my($session, $entity, $timestamp, $action,
       $state, $login, $fullname, $groups) = @_;

    # Note: This example doesn't record which fields actually changed.
    return "AuditTrail: " . $timestamp . $action . $state .
             $login . $fullname . $groups . "\n**********\n";
} 
Arguments:
  • $session: The current session object.
  • $entity: The entity object for which an audit trail is being written.
  • $timestamp: A string-formatted time-stamp value. (You can specify a custom time stamp field or omit the field.)
  • $action: The name of the action that is being executed.
  • $state: The current state of the record. If the action has modified the state, this field shows the new state.
  • $login: The name of the user, as represented by HCL Compass software. (If LDAP authentication is in use, this name may be different from the one that was used to log in to the HCL Compass environment.)
  • $fullname: The full name of the user, if it is known in the HCL Compass environment.
  • $groups: A list of the HCL Compass groups to which the user belongs. (If LDAP authentication is in use, the groups directory may hold group names that are independent of those managed by HCL Compass software.)
Return value: A string that represents the full audit trail entry to be written to the log, including delimiters and space between entries.