In my web application I need to check the old (already saved) field values and compare them with new values (i.e. changes being made by the user). I need this to maintain audit trial.
can anyone pls suggest a way. I have already tried something but it has failed and have posted a topic regarding this before also.
Subject: Compare Old fld values Vs. the changes being made
Did the AuditManager from Openntf not work for you? What failed?
Subject: Compare Old fld values Vs. the changes being made
Mike, We already have a specific way and look in which Audit trial is maintained for client application. So, I am avoiding using Audit Manager. But, going through it’s code has really helped me.
For all those who might be searching for a reply to similar query, this is the reply & its all thanks to JVR, Neil Gower, Damiel Katz & OpenNTF …
Steps:
-
Set NewDoc with DocumentContext
-
Get DocID (UNID) from this NewDoc
-
Delete NewDoc
-
Get OldDoc with the Doc ID, get all Old field values
-
Again set NewDoc and get all New field values
Logic:
When we need to get the document before it was saved, so we might be able to get the old field values try to get the existing doc using the UNID of the new one. We’ll have to get the on-disk document instead of the in-memory one. First you delete the DocumentContext reference, then grab the doc by UNID to get it on-disk, and then use DocumentContext again to get the in-memory copy
Subject: RE: Compare Old fld values Vs. the changes being made
The old topic—>
JYR