Manage Learn to apply best practices and optimize your operations.

Sorting keywords in Notes UI document's fields

This tip describes how to sort key words in the Notes user interface.

Suppose the following situation exists that you have some values in "categories" text field and you want them to appear in alphabetical order. The following code makes it. With slight modification you can make it as button action or agent. Enjoy


 Sub Click(Source As Button)
 Dim wsp As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Dim doc As NotesDocument
 Set uidoc=wsp.CurrentDocument
 Set doc=uidoc.Document
 
 lb=Evaluate(|@Elements(Categories)|,doc)
 Redim CatVal(Cint(lb(0))-1)
 
 Forall i In doc.categories
  CatVal(counter)=Cstr(i)
  counter=counter+1
 End Forall
 
 Dim j As Integer, k As Integer 
 Dim tmp As String
 
 'Sorting procedure ascending 
 
 For k=Lbound(CatVal) To Ubound(CatVal)
  For j=k To Ubound(CatVal)
   If Left(CatVal(j),1)<Left(CatVal(k),1) Then 'to sort descending just change the equation sign to ">"
    tmp=catval(j)
    CatVal(j)=CatVal(k)
    CatVal(k)=tmp
   End If
  Next
 Next
 Call doc.ReplaceItemValue("Categories",CatVal())
 Call uidoc.Refresh
End Sub

Dig Deeper on Domino Resources - Part 4

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