Insert DocLinks live whilst in edit mode without closing and re-opening the document. Impossible? Only if you use a rich text field. There is another way and with this tip it is impossible to tell the difference!
What you need:
On the form have a field called "Link", text, editable, hidden, default value = "". Paste a picture of a doclink on the form and create an Action Hotspot on the picture with the formula @URLOpen(Link), also hide the image when Link is = "" In the database you want to create links to you need a view called "All" which shows all documents. first column sorted.
How it works:
It's really simple, when you select the document you want to create the doclink to, you gather enough information to create a Notes type URL like this:
notes://server/datebase/view/docID?opendocument. This is created in the field called Link and is what is launched when the image of the doclink is clicked.
I use script to create a Picklist using a view in the target database. Once the script has run, it calls the uidoc refresh which makes the doclink image appear on the screen. You can click the button over and over < and > each time the doclink will, point to the last document selected. From a users point of view there is no < difference > between the image of the doclink and a "real" doclink.
Sub Click(Source As Button) Dim ws As New NotesUiWorkSpace Dim uidoc As NotesUIDocument Set uidoc = ws.CurrentDocument Dim thisdoc As NotesDocument Set thisdoc =uidoc.Document Dim session As New NotesSession Dim db As NotesDatabase Set db = session.CurrentDatabase Dim collection As NotesDocumentCollection 'Launches a modal window dispaying all of the documents Set collection = ws.PickListCollection (1, True, "Arcadia", _ "production/thatdb.nsf","NameOfView", "Select a Document", "Select a Document") If collection.count = 0 Then Exit Sub End If Dim doc As NotesDocument Set doc = collection.GetFirstDocument thisdoc.ProjectNumber = doc.ID(0) thisdoc.Description = doc.ProjectName(0) thisdoc.Author = doc.Author(0) thisdoc.Department = doc.BusinessArea(0) thisdoc.BusinessDept = doc.BusinessDept(0) thisdoc.BusinessDivision = doc.BusinessDivision(0) thisdoc.BusinessSubDivision = doc.BusinessSubDivision(0) thisdoc.Link = "notes://Arcadia/production/thatdb.nsf/All/" & Cstr(doc.UniversalID) & "?openDocument" Call thisdoc.Save (True, False) uidoc.Refresh End Sub