Sort totals in categorized views

Notes calculates totals for categorized views, but does not sort them.
So if you need it anyway, you have to

  1. navigate the categories in the non-sorted but categorized view (by means of the NotesViewEntry… classes)
  2. create a new document for each category with a field to record that total and a field to record that category
  3. add a non-categorized view for showing the new documents with a sorted column for the total field

Here is the LS code for an agent that implements 1- and 2-

{[.=Totals of categories= /enzymes/chili-ls.php]}

(revised text from my own comment 12349447 at Experts-Exchange)

Compose in a new window

To compose a document in a new window, make a button with the following formula:

@SetTargetFrame( “_blank” );
@Command( [Compose]; “a form” )

(revised text from my own comment 12095830 at Experts-Exchange)

Keep current order

SearchOrder=[1,2,3,4]
Indicate 1 to “Sort by relevance,” 2 to “Sort by date ascending,” 3 to “Sort by date descending.” The default is 1. SearchView also supports a SearchOrder value of 4 to “Keep current order,” which sorts the resulting set of documents in the order in which they appear in the view.

(from URL commands for searching for text, Notes Designer Help database)

Don’t let the “Keep current order” option mislead you. The resulting set is what comes after selecting the documents that match the search query (SearchOrder=1) and cutting out all the documents outside the range [Start, Start + Count – 1]. So, whatever the order in which they appear in the view, any page of documents is all messed up.

This is a bug that only shows up when searching views and paging the result set, i.e. almost always when searching views, i.e. almost always when searching. At any new page request, either with the same query or not, Notes conducts a brand new search, where the resulting set is sorted in a most-relevant-to-Notes way, if SearchOption=4 was specified. Then Notes extracts all the Count documents beginning from Start, and finally shows them in the order in which they appear in the view.

It could be said that “SearchOrder=4” has a resulting-page scope, as opposed to a resulting-view scope.

(revised text from my own comment 12067686 at Experts-Exchange)