NotesView (JavaScript)

Represents a view or folder of a database and provides access to documents within it.

Access

You can access a view or folder as follows:
  • To access all the views and folders in a database, use getViews in NotesDatabase.
  • To access one view or folder when you know its name or alias, use getView in NotesDatabase.
  • To access a view or folder that is a page-level data source, use its global object name, for example, view1 or view2.

Returned is a NotesView object or a vector of NotesView objects that represent accessible views and/or folders in the database. These NotesView objects may be public views or folders, or private views or folders stored in the database that are owned by the effective user ID. Personal views and folders stored in the desktop cannot be accessed by programs.

To access a view or folder when you have a view entry, use getParent in NotesViewEntry.

Usage

A NotesView object provides access to NotesViewEntry, NotesViewEntryCollection, and NotesViewNavigator objects:

A NotesView object provides access to NotesViewColumn objects, which contain information on each column in the view.

If you create a NotesView object then change a document so that it affects the underlying view, navigation with the NotesView object may produce incorrect results. You must refresh the NotesView object or create a new one. Document changes that affect views include additions, deletions, and changes to fields used by selection formulas.

Automatic updates: avoid

Avoid automatically updating the view by setting IsAutoUpdate especially if the view is a base for navigators or entry collections. Automatic updates degrade performance and may invalidate entries in child objects (Entry not found in index). You can update the view as needed with refresh.

Variable name view: avoid

Do not use view as a variable name to avoid confusion with the global variable by that name. The global variable named view does not refer to a Notes® view but to the top-level container control, that is, the XPage itself.