putAllInFolder (NotesViewEntryCollection - JavaScript)

Adds the documents associated with all the entries in a view entry collection to a specified folder.

Defined in

NotesViewEntryCollection

Syntax

putAllInFolder(folderName:string) : void

putAllInFolder(folderName:string, createOnFail:boolean) : void

Parameter Description
folderName The name of the folder in which to place the documents. The folder may be personal if the program is running on the workstation. If the folder is within another folder, specify a path to it, separating folder names with backslashes and escaping the backslashes in a literal, for example: putAllInFolder("Vehicles\\Bikes")
createOnFail
  • If true (default), creates the folder if it does not exist.
  • If false and the folder does not exist, this method does nothing.

Usage

If a document is already inside the folder you specify, putAllInFolder does nothing for that document. If you specify a path to a folder, and none of the folders exist, the method creates all of them for you.

Examples

This button puts in a folder all documents in a view that match a search query.
if (requestScope.query.isEmpty()) return;
if (!database.isFTIndexed()) database.createFTIndex(0, false);
var vec:NotesViewEntryCollection = database.getView("main").getAllEntries();
vec.FTSearch(requestScope.query);
if (vec.getCount() > 0) {
	vec.putAllInFolder("searchResults", true)
	requestScope.status =  "Document(s) put in folder";
} else {
	requestScope.status =  "No match";
}