Subject: opendocument and lotusscript
Writing things for a web-browser audience is a bit different than for the Notes client.It sounds like you’re probably using code in the QueryOpen event to populate the field in the Notes client. For the web, you have to write an agent with the code in it, and call the agent by putting { @Command([ToolsRunMacro];“Name of Your Agent”) }
into the WebQueryOpen event.
Also, VERY importantly… you MUST call a save of the document in order for any RichText fields to be updated on the new form!!
I don’t know how you’re finding the document you’re taking your information from, but here’s some starts:
Dim Session as NotesSession
Dim Doc as NotesDocument
Dim ReferenceDoc As NotesDocument
Set Doc = Session.DocumentContext
Set ReferenceDoc = <Your already populated document)
Call ReferenceDoc.CopyAllItems(Doc)
Call Doc.Save(True)
That should be enough code to get your document open in the web browser with the rich text fields populated properly. (They might not display quite the way you expect.)
Things you’ll need to watch out for: Since you have saved the document in the WebQueryOpen agent… it is now saved in the database. You should have WebQueryClose agent that marks the document as “properly” closed and saved (just make a field that you can mark true or false.)
I suggest this because users have a way of going away from their desks, letting their browsers authentication timeout, and going on to other web pages without saving documents. Since you’ve saved the document in the WebQueryOpen… you could end up with incomplete document cluttering up your applicaiton.
If you have a field that’s marked on them when they are PROPERLY saved into the database, you can create a schedule agent that runs say… every hour… and deletes any documents that are more than 3 hours old of the type you’re working with that are NOT tagged as being properly saved.
Have fun! =D