Adding logging in Lotus Notes form

2019-08-05 15:25发布

I want to add logging capabilities in my Lotus Notes application. Basically I want to be able to log who make the change, when the change is made, and what field(s) is/are changed in a document. What is the best way to do this? I am thinking to also add this at the end of each document so the user knows who make the changes.

3条回答
一夜七次
2楼-- · 2019-08-05 16:03

I've done this before using LotusScript. It's a bit of a pain, but the basic idea is to:

  • Create an array or new document object within the QueryOpen event, and store the values for all the items in the current document.
  • In your QuerySave event, compare the values of the current document to the in-memory copy you made, and then log any differences.

You can create a field on the form to write these changes to, and just append to it each time.

Watch out for other event handlers that make changes everytime the document opens, though. You may need to copy original values in the PostOpen event, for example, if you change some fields in the QueryOpen event each time the doc opens, otherwise you'd get false change logs.

Hope this helps!

查看更多
老娘就宠你
3楼-- · 2019-08-05 16:09

OpenNTF has several tools for this purpose that you could use, including Open Audit and Audit Manager.

查看更多
劳资没心,怎么记你
4楼-- · 2019-08-05 16:23

A "brute force" approach can also work. Every time a document is saved, create a copy of that version to a (separate) database. This will build an audit trail of the documents. The documents can be compared to extract the changes.

There is quite some overhead in this approach, but in my experience it has been worth it. The implementation is simple and all changes are captured without affecting the actual document. All information that is needed is captured and available for (offline) processing.

查看更多
登录 后发表回答