Search view using database search


// get the view
var v:NotesView = database.getView("(People)");

// set the value to search for
var dep = "Finance";

// filter the query using the views selection formula and extend it to the department field
var query = v.getSelectionFormula() + " & DEPARTMENT = \"" + dep + "\"";

// do the search and return a NotesDocumentCollection
return database.search(query);
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
1 comment(s)Login first to comment...
Alice Smith
(at 06:38 on 04.11.2017)
We can easily extend the formula to other fields.