Problem solve Get help with specific problems with your technologies, process and projects.

Set a value in a field existing in another Lotus Notes database

Learn the LotusScript code you'll need to use to set a value in a Lotus Notes field that resides in a different Lotus Notes database.

How do I set a value in a field that resides in a different Lotus Notes database?

To set a field on a document in another Lotus Notes database, you must create LotusScript or Java code for that specific Lotus Notes database object. Ideally, the code will locate the Lotus Notes document -- using a view lookup, full-text search, or by the Unique Notes Identification Number (UNID) -- and then update its value on that Lotus Notes document. Remember to save the Lotus Notes document after updating the field, or the changes will not be saved.

Your code should look something like this:

Dim session As New NotesSession
Dim dbTarget As NotesDatabase
Dim docTarget As NotesDocument

Set dbTarget = session.GetDatabase
("Server", "filename.nsf")
If (dbTarget.IsOpen) Then
Set docTarget = dbTarget.GetDocumentByUNID
("document UNID")
If Not (docTarget Is Nothing) Then
Call docTarget.ReplaceItemValue
("field_name", "new_value")
Call docTarget.Save (True, False)
End If
End If

Do you have comments on this Ask the Expert Q&A? Let us know.

Related information from SearchDomino.com:

Dig Deeper on LotusScript



  • iSeries tutorials

    Search400.com'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 ...