i'm a newbie for lotus notes as well as lotus script. i wish to know whether is it possible to access to the information of a database from another database..?
Lets say i got 2 databases - database A and database B. Database A contains user id and name, and i wish get the name from database A when the user id keyed in a form of database B matches the user id in database A. That means i wish to show the user name in the view of database B.
p/s: please show me the coding for the above case.
Subject: retrieve information from different databases
I haven’t provided the solution, but a general start to your issue. You will probably have to explain the issue a little clearer to get more responses. I am a beginner too.
You may want to check @DBlookups in formula which are quite easy.
For LotusScript you need to use Getdatabase - check Designer Help file. There are all sorts of options of gettings the document or item in question & it also depends on the content of the field.
I found that using Print, helped debug. As you always find there is an ‘but in this circumstance use…’ when starting to learn LotusScript. As below. Output appears in Server log when run as an agent.
Generally…
Set the Dimensions
Get the database
Get the view
Get the document
Get the Item
Dim db As Notes Database
Dim view As NotesView
Dim doc As NotesDocument
Dim Item As NotesItem
Set db = session.GetDatabase(“servername” , “databasename.nsf”)
Set view = nab.GetView(“($Users)”)
Set doc = view.GetDocumentByKey( n, True)
If doc.HasItem(“specificfield”) Then
Print "Document Found"
Else
Print "Document not found"
End If