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

How to capture values from one doc to another using LotusScript

This developer wants to know how to capture all the values from one document and load them into the correct field on another document, using LotusScript.

I have a form that has a checkbox which contains values such as Accounting, Service and Maintenance. The user is able to select one or more of these values from the list. I need to run through the values that the user has selected and add his or her name to another field on another document that corresponds to their selection.

The fields that appear on the other document are Accounting, Service and Maintenance. If the user has selected Accounting, their name is to be added to the Accounting field, and so on. The document that we are loading their name to is used for mailings corresponding to their selection. The intent is to have this information populate the document at the time the user submits the document. I would like to do this dynamically, but am not sure how I can capture all of the values and load into the correct fields. I am writing this in LotusScript.

Something like this will help you out:
 Dim ws As New NotesUIWorkspace
 Dim doc As NotesDocument
 Set doc = ws.currentDocument.document
 Dim item As NotesItem
 Dim MyType As NotesItem
 Set MyType = doc.getFirstItem("MyTypes")
 'MyTypes is the field with the values the user selected'
 Forall SelectedType In MyTypes.Values
  Set Item = doc.ReplaceItemValue
( SelectedType, "UserName" )
 End Forall
      'save the document'

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




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