Andre, thanks for the response.
There is some history here that can be followed in two previous posts from yesterday (9March). The syntax is incorrect as you point out, I hurriedly copied and pasted this in because I didn't want to overcomplicate. That should be rt2.
Yes there are subroutines, one of which is the CreateNewResponse (actually a function that passes back the new response as a Notes Document). The db object is never closed or deleted that I'm aware.
Really all I was trying to do is update a rich text field. I have tried your method that updates the uidoc a save from openntf.org. It actually works. But what was strange was when I went to close the uidoc doc I was prompted - if I said NO - the next time I opened, the link was there.
Your method seems to create a new instance of uidoc (uidocNew) and so I couldn't use that because my doc is still active. (covered extensively here: http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/9162774228d2afb28525712c0054fb02?OpenDocument
I was able to see the new doclink in the richtext field, but I still could not programmatically close the window at the end of the agent (with say uidoc.Close(True) because that would lose the link.
Anyway, I stopped fighting the inevitable and stored all the rich text information on a separate doc in the back end and then moved the appendRTitem to an section after the End Select Low and behold I was completely unable to ever get back to that document.
What is very strange here is that no matter how I try to return to that back end document, even Dimming and SEtting a brand new instance, I can't seem to get to it. However Timothy makes a good point that I'm using byID and not byUNID so I need to run that through right away.
I will update shortly...