addEntry (NotesViewEntryCollection - JavaScript™)
Adds an entry to a view entry collection.
Defined in
NotesViewEntryCollectionSyntax
addEntry(object:any) : void
addEntry(object:any,
checkDups:boolean)
: void
Parameter | Description |
---|---|
object |
A NotesViewEntry or NotesDocument object representing the entry to be added. Cannot be null. A NotesViewEntry object must be of type document. |
checkDups |
If true, forces a remote (IIOP) add to be made immediately rather than at the next navigation or other method (such as stampAll) that calls the server, so that a duplicate exception can be thrown immediately. Does not work for local calls. |
Usage
The entry or document represented by the parameter must exist. For example, if you create a new NotesDocument object, you must save it before calling addEntry.This method increments the view entry collection count returned by getCount.
Examples
This button puts in a folder documents found through a search plus the current document.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) {
var doc:NotesDocument = currentDocument.getDocument();
if (doc != null) vec.addEntry(doc, true);
vec.putAllInFolder("searchResults", true);
requestScope.status = "Document(s) put in folder";
} else {
requestScope.status = "No match";
}