Home > Ask the Domino Experts > Domino Designer Questions & Answers > Set a value in a field existing in another Lotus Notes database
Ask The Domino Expert: Questions & Answers
EMAIL THIS

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

Brad Balassaitis EXPERT RESPONSE FROM: Brad Balassaitis

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 03 June 2008
How do I set a value in a field that resides in a different Lotus Notes database?


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Domino Designer
Resolve Notes 8 migration error: 'Database has not been opened yet'
Lotus Notes access error: 'database is not opened yet'
Stop response documents from showing in a Lotus Notes form
Create an automatic scheduled view export in Excel
Display Lotus Notes fields as separate entries in one column
Creating custom Lotus Notes Domino login forms
Using LotusScript to retrieve names of fields on a Lotus Notes form
Importing data from Microsoft Excel to a Lotus Notes form
Error creating product object
Is LotusScript needed to validate fields on form?

LotusScript
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication
Can I create and copy Microsoft Excel spreadsheets with LotusScript?
LotusScript filters and attaches files to a Notes form
How to create mail files using a LotusScript agent
Can you use LotusScript to read a text file attached to a Notes doc?
Extract value pairs from text arrays with LotusScript

Lotus Domino Designer
An introduction to using XPages in Domino 8.5
Top 10 Lotus Notes/Domino coding and development tips of 2008
'Customize this view' options are disabled in Lotus Notes databases
Stop response documents from showing in a Lotus Notes form
Display Lotus Notes fields as separate entries in one column
An introduction to Lotus Domino Designer
Modifying LotusScript code for date and time handling
Creating custom Lotus Notes Domino login forms
Using LotusScript to retrieve names of fields on a Lotus Notes form
Top 10 Lotus Notes Domino programming and development tips of 2007

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


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:

  • Tutorial: 30 LotusScript tips
  • 10 tips in 10 minutes: Top LotusScript tips
  • Expert Advice: Setting the field value of a table
  • Reference Center: LotusScript
  • Reference Center: Lotus Domino Designer




  • Search and Browse the Expert Answer Center
    Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
    Browse our Expert Advice



    Lotus Notes Domino on Blackberry and mobile devices
    HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts