// 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);