getLastDocument (NotesView - JavaScript)

Returns the last document in a view.

Defined in

NotesView

Syntax

getLastDocument() : NotesDocument
Return value Description
NotesDocument The last document in the view. Returns null if there are no documents in the view.

Usage

If the view is filtered by FTSearch, this method returns the last 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 last to first.
var v:NotesView = database.getView("main");
var doc:NotesDocument = v.getLastDocument();
while (doc != null) {
	requestScope.status += "\n" + 
		doc.getItemValueString("subject");
	var tmpdoc = v.getPrevDocument(doc);
	doc.recycle();
	doc = tmpdoc;
}