getView (NotesDatabase - JavaScript)

Finds a view or folder in a database, given the name or alias of the view or folder.

Defined in

NotesDatabase

Syntax

getView(name:string) : NotesView
Parameter Description
name The case-insensitive name of a view or folder in a database. Use either the entire name of the view or folder (including backslashes for cascading views and folders), or an alias.
Return value Description
NotesView The view or folder whose name or alias matches the parameter.

Usage

This method returns public views and folders and private views and folders that are owned by the effective ID.

When specifying the parameter, do not combine the view name and an alias. For example, specifying By Author|AuthorView does not work. Use either the view name (By Author) or its alias (AuthorView).

When the view or folder name contains underscores to indicate menu accelerators, you have the option of including or excluding the underscores. The method works more efficiently, however, if you include the underscores.

Examples

This computed field displays the number of columns in a view.
var v = database.getView("All");
if (v == null) return "No \"All\" view."
return "Number of columns in \"All\" view = " + v.getColumnCount()