Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

There was an oft-repeated question in the Notes 6&7 forum this morning, which inspired me to write the attached utility. This is for where you have a table on a form with a field in each cell, and you want to be able to keep the table sorted by one or more columns.

The source file is attached, which you can import into a script library or the globals section of the form or whatever.
To invoke the sorting function, make a call such as:

Call SortATable(uidoc, "Key,DueDate,Comment,OrderAmt", "Key", 5, "_", True)

The arguments, in order, are:
  • A NotesUIDocument (for the document you're editing), or a NotesDocument (if you want to sort data in a back-end document).
  • A comma-delimited list of the fieldnames in the table, minus the numerical suffix designating the row.
  • A comma-delimited list of which of these you want to sort by.
  • The number of rows in the table.
  • The character used to separate the column name from the row number to create the fieldname.
  • True for ascending, False descending.
If the first key field is blank, that row will always drop to the end of the table. The _1 on the fields of the first row are optional (as shown above).

Andre Guirard | 4 August 2008 12:29:51 PM ET | Home, Plymouth, MN, USA | Comments (5)

Search this blog 


    About IBM Privacy Contact