SelectionFormula (NotesNoteCollection - JavaScript™)
Read-write. Formula that selects notes for inclusion in the collection.
Defined in
NotesNoteCollectionSyntax
getSelectionFormula() : string
setSelectionFormula(flag:string)
: void
Usage
This property must be a valid Domino® formula that evaluates to True (includes the note) or False (excludes the note) for each note.
This property is initially an empty string, which is equivalent to selecting all notes.
This property is not a stand-alone specification. It intersects the other selection criteria.
This is not a good way to display a selected set of documents for a specific user. When you use this property to change the view selection, it applies to all users of the view.
There are problems with using this method to make a view display a new selection of documents for an end user:
- Do not give end-users Designer access to an application.
- If it is a shared view, users will interfere with each other's searches.
- The Notes® client caches design information, and there's no way to tell it to update its cache (except for outlines). Exiting and re-entering the application usually works, but it's hard to programmatically ensure the user exited the application entirely.
- It is an inefficient way to search unless the result set is very large. If your database contains many documents, it may take a long time to display the view the first time it's used after changing the selection formula, because every document in the database must be examined to determine whether it meets the selection criteria. Use a full-text search instead. For displaying personalized subsets of documents, you might use private views, single-category formulas for embedded views or the @SetViewInfo function.
This method makes a modification to the design of the view and requires Designer access. If not, the view is private and the user is the owner of it.
If you use a composite application, you can set up an NSF component containing a view and make the view conduct a full-text search. If you are not in a composite application, there are other ways to control the UI to conduct searches for the user. Consult the Domino® Designer wiki for techniques.