getFirstDocument (NotesView - JavaScript)

Returns the first document in a view.

Defined in

NotesView

Syntax

getFirstDocument() : NotesDocument
Return value Description
NotesDocument The first 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 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;
}