getAllUnreadDocuments (NotesDatabase - JavaScript)

Creates a document collection of all unread documents in the database.

Defined in

NotesDatabase

Syntax

getAllUnreadDocuments() : NotesDocumentCollection

getAllUnreadDocuments(userid:string) : NotesDocumentCollection

Parameter Description
userid If present, the method returns unread documents on behalf of the given name. If omitted, the method returns unread documents on behalf of the current user ID.
Return value Description
NotesDocumentCollection The new document collection.

Examples

This computed field displays the number of unread documents in the current database.
return "Unread documents: " + database.getAllUnreadDocuments().getCount();

Usage

If the database does not track unread marks, all documents are considered read, and this method returns an empty collection.