How to create doclink in backend from frontend doc

I am stuck. I have created some new functionality in a database that is ready except for one thing that I have been stuck on for a while.

Here’s what I am trying to do:

I have a newly created uidoc that contains a list of backend documents.

From a LS button I am trying to create a doclink in all of the backend documents in the list that will open the newly created ‘master document’

It sounds easy but I am not able to get it to work. The code I have now only creates a blank doclink. It doesn’t do anything when clicked, and the text shown when hovered over show the database name, not the text that I used in the appendoclink.

Here is a snippet:

Set doc = view.GetDocumentByKey(search)

Set rtitem = New NotesRichTextItem( doc, “Link” )

Set newdoc = uidoc.Document

Call rtitem.AppendDocLink( newdoc, “Master Invoice” )

Any help will be greatly appreciated!

Thanks, Shawn~

Subject: how to create doclink in backend from frontend doc

Save newdoc before you try to AppendDocLink.

Subject: RE: how to create doclink in backend from frontend doc

Thank you. I was saving the doc, but not correctly. It is working now… mostly. When I click the doclink it opens it in a different Form and it’s not the Form from the Form formula.

Is there a way to control what form a doclink opens in? I don’t want it to be the default form of the form formula.

Thank you.

Subject: *It will be the form specified by the Default View form formula.

Subject: RE: *It will be the form specified by the Default View form formula.

Thank you. Thank you. It works and you guys have been a big help!!!