Opendocument and lotusscript

HELP NEEDEDI am writing a WEB enabled product database where people can order as well.

  1. WEB agent creates a new document with items (copyallitems) from a document having all products for sale written by sales.

  2. The document is made correct and also RT items in notes are displayed. On the web not so (pictures). If somebody knows how to trigger this problem that would be great.

  3. Therefore I need an agent that re-opens the document in the browser. I don’t know how to open the just created document in the browser. Please help!!!

Bert

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

Subject: RE: opendocument and lotusscript

Thanks for taking the time to respond!

I followed the script above (slight different but main things the same - copyallimtems). This is working fine. That is to say that a new page opens with fields filled in from the ref doc.

But the RTF fields only show the text (also the RTFtext!) but not the actual product pictures in the same field. They are shown with a red cross in it.

Two remarkable points:

  • In notes the pictures are there shown proper.

  • If I open the same document through a openurl with ‘doc ID’ or from Action-preview in web browser in the client, pictures are shown as well.

(a reload (F5) on the web doesn’t work)

I see two solutions:

  1. Find a way to proper show the pictures.

  2. Find a way to open de doc with ws.editdocument(doc). But ws (uiworkspace) is not allowed for web applications…

Any feedback welcome!!!

Subject: RE: opendocument and lotusscript

You might have to go back to the agent and actually copy all the embedded items in the RT Fields individually if it didn’t work that way.I don’t see why it wouldn’t work… but it obviously doesn’t.

There is code to do that type of thing right in the online help for Domino Designer… so I’d look there to add that functionality to your agent.

Subject: RE: opendocument and lotusscript

Did do so but doesn’t work.

Is anybody able to create a new document on the web, fill the RTF with graphs from other documents and show it proper in the browser??

Does anyone get getdocbyurl in LS working?

Does anybody have a web-agent opening a existing document in the database in a brower??

Please help!!