getNextDocument (NotesView - JavaScript™)
Given a document in a view, returns the document immediately following it.
Defined in
NotesViewSyntax
getNextDocument(doc:NotesDocument) : NotesDocument
Parameter | Description |
---|---|
doc |
Any document in the view. Cannot be null. |
Return value | Description |
---|---|
NotesDocument |
The document in the view following the specified parameter. Returns null if there are no more documents in the view. |
Usage
This method returns the next document in the view regardless of what type of document it is (document, response, or response-to-response). If you want the next sibling document in the view, use getNextSibling.If the view is filtered by FTSearch, this method returns the first document in the filtered view.
The NotesViewNavigator and NotesViewEntryCollection classes provide more efficient methods for navigating views and accessing entries.
Examples
This button gets all the documents in a view from first to last.var v:NotesView = database.getView("main");
var doc:NotesDocument = v.getFirstDocument();
while (doc != null) {
requestScope.status += "\n" +
doc.getItemValueString("subject");
var tmpdoc = v.getNextDocument(doc);
doc.recycle();
doc = tmpdoc;
}