I have a main document with a submit button that calls an agent. The agent loops a field for values and creates a new response document for each value - then puts a link to the response in a rich text field. After appending to a richtextitem all the links, I do a doc.Save. The agent then goes on to set a couple more fields. If I close the document it prompts for a save. If i save it, my RT field no longer retains the links I created. If I close and don’t save, the next time I re-open the doc, the links are present.
I’ve tried uidoc.Save, uidoc.Reload, uidoc…
If I do any processing to the document, I lose my links, and I can’t get them to stick.
Has anyone seen anything like this before? I’d be interested in your thoughts.
Thanks - JD
excerpt:
create the rti:
Set doc1 = uidoc.Document
Set rtitem = New NotesRichTextItem( doc1, “responsedoclinks” )
create the responses:
Set doc2 = New NotesDocument(thisdb)
Call doc2.MakeResponse(doc1)
Call doc2.Save(False, True)
place a link on the parent:
Call rtitem.Appendtext("Application Doc: " & doc2.applicationname(0)& " → ")
Call rtitem.AppendDocLink(doc2, "Application doc: "& doc2.applicationname(0))
Call rtitem.AddNewline(1)
save it
doc2.Save(True,False)
------ actually works OK if I manually close the document (escape key)
Include this procedure inside more code:
Call createresponse
Call uidoc.FieldSetText(“Activity”, “Submitted”)
Call uidoc.FieldSetText(“Status”, “Sent”)
Call uidoc.Save()
Call uidoc.Close()
this will lose the links
Put the lniks code behind a button I get the case where if I close with escape key - it prompts for a save - If I say Yes - I lose the links - If I say No - the links are still there!