Set CorpDB = session.GetDatabase(session.CurrentDatabase.Server,“FormsRequest.nsf”)
Dim rti As NotesRichTextItem
Set rti = New NotesRichTextItem(newDoc,“Body”)
Dim newdoc As NotesDocument
Set newdoc = New NotesDocument(CorpDB)
newdoc.Form = “PDF Project Request”
Call rti.AppendDocLink(doc,“”)
Call newdoc.CopyItem(rti,“RelatedRequest”)
Error:
You may not save a Document Link into this field unless the linked-to database is the current database.
Summary:
I have a document open. This is my uidoc. I need to create a new document in another database and I need to attach a link of my uidoc into the other database. The other database is FormsRequest.nsf. I’d like to know either what I’m doing wrong or an altogether better way to do this. Thanks!
Subject: when RT item created straight ahead nothing happens
(1) You noticed that newdoc is referenced before it is declared. Nice catch! In my actual code newdoc is declared 1st. I copied pieces of larger code to the forum & this was a cut & paste error.
(2) You suggested I create my “RelatedRequest” RT item straight ahead. This is what I tried first and when I use your code which is almost exactly what I had nothing happens. The doclink I’m trying to insert doesn’t show up. Therefore, I’m trying to create the rich text item first then copy it to my field. This almost works, but not quite. I’m able to get the doclink inserted, but I get a bunch of pop-ups because Notes doesn’t like what I’m trying to do.
Set rti = New NotesRichTextItem(newdoc, “RelatedRequest”)
Call rti.AppendDocLink(doc,“”)
Call rti.Update
Call notesRichTextItem.Update
Processes all pending operations on a rich text item. Operations on a rich text item are queued for efficiency. The order and time of completion are not predictable. Use this method to ensure that processing is complete at a certain point. This method is useful when interacting with the front-end classes.