markAllUnread (NotesViewEntryCollection - JavaScript™)
Marks all of the documents in a collection as unread.
Defined in
NotesViewEntryCollectionSyntax
markAllUnread() : void
markAllUnread(username:string) : void
Parameter | Description |
---|---|
username |
If present, the method marks all of the documents in the collection as unread on behalf of the given name. If omitted, the method marks all of the documents in the collection as unread 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.markAllUnread();
requestScope.status = n.toFixed() + " document(s) marked as unread";
} else {
requestScope.status = "No match";
}