Manage Learn to apply best practices and optimize your operations.

Insert DocLinks live without closing and re-opening the document

This tip describes how to insert DocLinks live without closing and re-opening the document.

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", _
"Select a Document", "Select a
     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 = 
     thisdoc.Link = 
"notes://Arcadia/production/thatdb.nsf/All/" &
Cstr(doc.UniversalID) & "?openDocument"
     Call thisdoc.Save (True, False)
End Sub

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...