Manage Learn to apply best practices and optimize your operations.

Populating a number field using LotusScript

SearchDomino.com member Jerry Fogle offers a quick LotusScript technique that will populate a number field on a Lotus Notes UI document with a processed list. All you have to do is create a number field with "allow multiple values" and "computed when composed" selected, and then create a button using the LotusScript code provided in this tip.

Here's a quick way to populate a number field on a Lotus Notes UI document with a processed list using LotusScript. Just create a number field with "allow multiple values" and "computed when composed" selected. Then, simply make a button with the following LotusScript code:

 
Sub Click(Source As Button)
 Dim w As New notesUIWorkspace
 Dim uidoc As notesUIDocument
 Dim doc As notesDocument
 Set uidoc = w.currentDocument
 Set doc = uidoc.document
 
 Dim idlist As Variant
idlist = Evaluate(|@DbColumn
("Notes":"NoCache";"";"yourview";1)|, doc)
 Dim a() As Integer
 Redim a(0)
 Forall v In idlist
  a(Ubound(a)) = v
  Redim Preserve a(Ubound(a)+1)
 End Forall
 Redim Preserve a(Ubound(a)-1) 
 doc.yournumberfield = a
 Call doc.Save( True, True )
End Sub

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Jerry Fogle. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

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

SearchDataCenter

SearchContentManagement

Close