Manage Learn to apply best practices and optimize your operations.

Get sorted results from complicated search criteria

Here is a simple trick to get a collection of sorted search results set to specific user options.

Use the high power in Notes Formula to get fast and easy to use search criteria by using a computed field to collect the selected options -- without including the sort conditions.

Use the resulted criteria in your script or agent to get the document collection from the database without having to sort using the method (db.Search(Formula, Nothing, 0) or other conditions.

Here is a simple trick to get a collection of sorted resulst set to specific user options:

  1. Create one or more hidden folders with columns sorted/categorized to your dialog options.

  2. Determine the required sort options found in the dialog, and then determine what folder name to use (you may do this in a formula in the dialog, so you get the folder name directly from the dialog).

    Empty the folder of any existing documents from a previous operation.

  3. Put the collection in the folder. Now you have the collection sorted to the user requirements.

  4. Loop on the collection by getting the first, then next document from the folder.

  5. Process the document according to the operation tasks.

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

This tip was submitted to the tip exchange by member Sirry Hboos. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on Lotus Notes Domino Formula Language

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials'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 ...