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

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close