markAllRead (NotesViewEntryCollection - JavaScript™)
Marks all of the documents in a collection as read.
Defined in
NotesViewEntryCollectionSyntax
markAllRead() : void
markAllRead(username:string) : void
Parameter | Description |
---|---|
username |
If present, the method marks all of the documents in the collection as read on behalf of the given name. If omitted, the method marks all of the documents in the collection as read on behalf of the current user ID. |
Usage
If the database does not track unread marks, all documents are considered read, and this method has no effect.Examples
This button marks as read all documents in a view that match a user 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);
var n:int = vec.getCount();
if (n > 0) {
vec.markAllRead();
requestScope.status = n.toFixed() + " document(s) marked as read";
} else {
requestScope.status = "No match";
}