Manage Learn to apply best practices and optimize your operations.

View and open documents from another database

View and open documents from another database.

This button allows you to get a view from Database2 and open its documents from a document in Database 1.

Action button in a document in Database1:

Sub Click(Source As Button)
Dim wK As New NotesUIWorkSpace
Dim S As New NotesSession
Dim doc As NotesDocument, Doc90 As NotesDocument
Dim UIDoc As NotesUIDocument
Set db=S.CurrentDatabase
Set uidoc=wk.currentdocument
Set doc=uidoc.document
Dim db90 As New notesdatabase(db.server,"Db2.nsf")
If Not db90.isopen Then
Call db90.Open( "", "" )
End If
If wk.DialogBox( "dialogbox900", True,True, False, False, False,False, "View Documents from Database2",doc) Then

If doc.Field1(0)<>"error" And doc.Field1(0)<>"" Then

UnivID=Strrightback( doc.Field1(0), "**") 
Set doc90 = db90.GetDocumentByUNID( Cstr(UnivID) )

Call wk.editdocument(False,doc90,True)

End If 'Error

End If 'Dialogbox
End Sub

The form "Dialogbox900" is in Database1 and have a list box ("Field1") with this formula to select some documents from a view in Database2 (form properties, 2nd tab):

server := @Subset(@DbName; 1);
tempvar := @DbLookup( "" : "NoCache" ; server : "db2.nsf" ; "ViewName" ; Key ; 1 );
@If(@IsError(tempvar); "Document not found|error";
@Text(@DbLookup( "" : "NoCache" ; server : "Db2.nsf" ; "ViewName" ; Key ; "dialogbox900" ))


In Database2 you have to add a column to a view (name of the column: "dialogbox900") with this code (column1 and 2, etc. are whatever information you have in this view):

@Text(column1)+"   "+@Text(column2)+@Repeat(" ";100)+"**"+@Text(@DocumentUniqueID)

Dig Deeper on Domino Resources - Part 5



  • 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 ...