Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum



PreviousPrevious NextNext

Tim Holt 22.Apr.17 07:43 PM a Web browser
Notes Client All Releases All Platforms


I am using some code that I found on the Forum to track all the Field changes in a document by putting comment in History section. It works pretty well except for 2 data types - dates and Rich Text.

If a value is in a Date field then it ALWAYS generates an entry for that field even if the field has NOT been changed. The debugger shows both old and new values to be exactly the same.

For Rich Text - it NEVER generates an entry when altered. In the debugger, it is getting the old value from the front end AND the back end, so it thinks there is never a change. I have tried a computed field with Abstract formula and same result.

Other than those two cases the code catches all the other field changes. Here is my code for review. Hopefully, someone can shed some light on how to make this work.

Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim session As New NotesSession
Dim ROSIview As NotesView
Dim originalDoc As NotesDocument
Dim whichField As String
Dim newValue As String
Set db = session.Currentdatabase
Set doc = source.Document

If Not source.IsNewDoc Then
Set ROSIview = db.getview("vwLkupByUNID")
Set originalDoc = ROSIview.GetDocumentByKey (Doc.UniversalID) 'Get handle on unchanged backend doc by using UNID.

Forall field In doc.Items 'Search thru all fields checking for any changes made.
whichField =
newValue = Cstr (field.text) 'Get value in front-end field so can compare to determine if it has been changed.

If (Left(whichField,1) <> "$") Then 'Skip all reserved fields beginning with "$".
oldValue = Cstr (originaldoc.GetitemValue( whichField )( 0 )) 'Get field in backend that has not been changed yet.
If oldValue <> newValue Then 'Compare backend value with frontend value and add entry when they are not the same.
entry = Chr$(10) + Now() + " " + session.CommonUserName + " changed " + whichField + " from " + oldValue + " to " + newValue
Call source.FieldAppendText("History",";"+entry)
End If
End If
End If
End Forall
End If


End Sub

Thanks for any help,

Tracking All Field Changes via Lotu... (Tim Holt 22.Apr.17)
. . Have you just considered using Note... (Carl Tyler 22.Apr.17)
. . . . RE: Have you just considered using ... (Tim Holt 24.Apr.17)
. . . . . . RE: Have you just considered using ... (Carl Tyler 24.Apr.17)
. . . . . . . . Versioning not good solution in thi... (Tim Holt 24.Apr.17)
. . RE: Tracking All Field Changes via ... (Saul Resnikoff 25.Apr.17)
. . . . RE: Tracking All Field Changes via ... (Stan Rogers 27.Apr.17)
. . . . . . Still looking for help in resolving... (Tim Holt 27.Apr.17)

  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite