VIEW MEMBER FEEDACK TO THIS TIP
To create a field for users to add notes or comments to a Lotus Notes document, you must first set up two fields.
The first, we'll call Cust_NotesTemp. It only has code in the Exiting Event. This is an editable field into which a user can enter notes or comments.
When they exit the field, the Exiting Event code trims the field of junk, stamps the new note or comment with the current date and time, adds a line feed. It then links the new comment together with the other comments already present in the Lotus Notes document, and saves it into the Cust_Notes field. When finished, it clears out the Cust_NotesTemp field.
One consideration is that the user may save the Lotus Notes document after entering comments into it, but before exiting the Cust_NotesTemp field. As such, the Exiting Event must be triggered when the document is saved by forcing the field exiting event, no matter where the cursor is. Move the cursor to some field at the beginning of the document that doesn't need any entering or exiting event code -- Call uidoc.GoToField("??? any field").
Now set up the second field and call it Cust_Notes. This field only has code in the Entering Event. This will store all notes or comments with dates/times, as well as the user's name that created each note. This is an editable, but restricted, field that only a user with manager access can edit. This prevents Lotus Notes users from changing their own comments or those of other users. Finally, add the following LotusScriptcode:
MEMBER FEEDBACK TO THIS TIP
I've found a much easier solution.
First, create two fields and call one Comments (make this an editable text field) and Comments_D (make this a computed text field). Next, use the following as the formula for the Comments_D field:
Place the form in edit mode, enter some text, save the document and finally close the document. I must
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

admit, this does not do the "clean up" that the author's LotusScript does, but that could be done with a couple of @ReplaceSubstring or @Replace commands added in.
Please allow me to add an appeal to everyone trying to do Lotus Notes/Domino development. Learn the @Functions! I see so many examples of programmers trying to do everything in LotusScript when a couple of simple @Functions can do the trick.
Randy D.
******************************************
Randy D. is on the right track. I use the Formula language a lot and I have a form with three fields to update comments into one field and then clear the previous two so that they are blank for the next user.
To accomplish this, create two editable fields (UpdateSubject, which is optional, and UpdateDetail) and one computed field (UpdateLog). Then, create a button on the form and put this code behind it:
This grabs the username, current date and time to add into the comment. The user types a subject in the UpdateSubject field (this is optional) and the comment in the UpdateDetail field. Then click the button and it immediately adds the comment to the log below. It saves the changes and then clears the Subject and Detail fields. It then saves the form again. You can use @Command([FileCloseWindow]) command at the end to close the document.
Linda T.
Do you have comments on this tip? Let us know.
Related information from SearchDomino.com:
Tip: Prompting a Lotus Notes user for input using LotusScript
FAQ: LotusScript advice
Expert Advice: How to modify a Lotus Notes signature file using LotusScript
Learning Guide: LotusScript development
This tip was submitted to the SearchDomino.com tip library by member Ray Green. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.