Document audit trails - updated from anywhere

This relatively small amount of code will create an effective audit trail that can be as simple or as comprehensive as you want.

The result is a trail that records each event on a separate line (Person/Date/Activity) showing the latest at the top. Recorded events can be any type of activity within the form from field value changes to action buttons. I have found it particularly effective where authorization routes are required such as when several people will be making changes to the same document.

This routine can be added to many areas within the form. I currently have it on exiting some crucial fields as well as approval routing buttons.

The trail is made up of three computed fields that are set in a three-column/one row table. Each field is text format and allows multiple values with the display viewed on separate lines. Their own field name is entered in the computed value section.

Note: For the field values to line up, you need to ensure that the action descriptions appear on one line only such as not too long which can be resolved with additional coding.

The fields are...

 AuditName AuditDate AuditDetails

The code can be added to your script action buttons or on exiting/entering a field. You need to ensure that the document is in Edit Mode to make a change.

The code is as follows and works very effectively. All you do is hardcode the message for the current activity. I also on occasions pick up field values using uidoc.fieldgettext("") and add them to the message.

 Dim s As New notessession Dim uiw As New notesuiworkspace Dim uidoc As notesuidocument Set uidoc=uiw.currentdocument 'Check uidoc is in edit mode uidoc.editmode=True 'Ammend Audit Trail AuditName=uidoc.fieldgettext("AuditName") AuditDate=uidoc.fieldgettext("AuditDate") AuditDetails=uidoc.fieldgettext("AuditDetails") AuditName=s.commonusername+Chr(10)+AuditName AuditDate="["+Str(Now)+"]"+Chr(10)+AuditDate AuditDetails="Enter your specific message here ..."+Chr(10)+AuditDetails uidoc.fieldsettext "AuditName",AuditName uidoc.fieldsettext "AuditDate",AuditDate uidoc.fieldsettext "AuditDetails",AuditDetails

This was first published in June 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.