Reputation: 636
In lotus notes 6.5 , how can i check if a document fields are different than before ?
Now i have put some code in the Queryopen that populate a field "changes" with some source document values and in the querysave i check if values that i had save during queryopen are different from the fields in the source document. If they change i have to update some other documents, in other case i don't have to update anything.
Is there other simplier solution ?
Upvotes: 1
Views: 1478
Reputation: 21
and you may also want - should be possible in Notes 6.5 - the use of ReplicationConflict settings on Forms 'Merge/NoConflict' or 'Do Not Create Conflicts', if feasible for you.
Upvotes: 0
Reputation: 5429
Take the same document via view lookup in QuerySave. Don't try to take same document via db.getdocumentbyunid (as it will read document from memory which is already modified) (see example below)
dim s as new notessession
dim db as notesdatabase
dim view as notesview
dim samedoc as notesdocument
set db = s.currentdatabase
set view = db.getview('lookupview')
' that is how you can get unsaved document from database (but not the one you already updated in QueryOpen event)
set samedoc = view.getdocumentbykey(key, true)
' samedoc - untouched one, form database;
' source - updated document
msgbox samedoc.keyitem(0) ' original value
msgbox source.document.keyitem(0) ' QueryOpen's value
Let me know if it does not work.
Upvotes: 2