I know this subject has been addressed in other topics, but I just can’t get my code to work and am getting very frustrated - I’ve been working on this one issue for over a week now!
Patrick Montavon posted an excellent piece of code in repsponse to an earlier question of mine about editing rich text (http://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/3b8122ecfe141e9885256fac005158b4?OpenDocument), but the problem is that, while it works in the button code he posted, it doesn’t work with the QuerySave event.
Here’s what I’m attempting to do:
-
The user makes some changes to a document, and possibly adds some notes.
-
On Save, I want to log those changes to a computed rich text history field, and add the notes as well, clearing the notes field.
Seems simple, doesn’t it? I want to use rich text because the users want formatting capabilities for their notes, and because these history fields can get quite big. Currently I use a plain text field which I have to periodically save off as a text file and attach it to the document as old history. This is a lame workaround for something that should be so simple and rich text has no limit in size.
When I use a button to call my UpdateHistory code, all behaves well. But when I call the code from QuerySave, the history field gets updated (and shows on screen) but never written to disk. I’ve even tried doing a second doc.save in the PostSave event but still no history save happens. The other fields on the form are saved however. If I do a manual second save on the form, the first history change gets saved.
Here’s another quirk: after doing the save which calls the updatehistory routine, which closes and reopens the ui doc and then removes the saveoptions field, the saveoptions field is still there! I’m sure that has something to do with this, but I can step through the code in debug and see the line “Call doc.Removeitem(“SaveOptions”)” get executed, but the field is still there if I look at the document properties box!
Does anyone have any ideas that would help me? This is driving me batty. Okay, battier.
Frustrated in San Francisco,
Beth