OpenNTF.org - Document audit trails - update
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Document audit trails - updated from anywhere 
Rating:
Rating: 5 , Number of votes: 1 
Contributor:
Andrew Jones 
Category:
Lotusscript 
Type:
Document Management 
Last Modified:
17 Jun 2002 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
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.

Usage / Example
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
 Comments

No documents found

 Add your comment!