createView (NotesDatabase - JavaScript™)
Creates a view.
Defined in
NotesDatabaseSyntax
createView() : NotesView
createView(viewname:string) : NotesView
createView(viewname:string, viewselectionformula:string) : NotesView
createView(viewname:string, viewselectionformula:string, templateview:NotesView) : NotesView
createView(viewname:string, viewselectionformula:string, templateview:NotesView, prohibitdesignrefreshmodifications:boolean) : NotesView
Parameter | Description |
---|---|
viewname |
A name for the view. Defaults to the "(untitled)" view. The view is created even if this name duplicates an existing view. |
viewselectionformula |
A selection formula. Defaults to either:
If specified, this formula overrides the selection formula of the template view. |
templateview |
An existing view from which the new view is
copied. Defaults to either:
Note: The template view cannot be of type "Shared, desktop private
on first use." |
prohibitdesignrefreshmodifications |
|
Return value | Description |
---|---|
NotesView | The new view. |
Usage
If no template view exists, the new view contains one column with "@DocNumber" as its value. The template view must be accessible to the program, so can be a public view or a private view owned by the effective ID running the agent, but cannot be a private view stored in the desktop.Examples
This button creates a new view with two views based on another view.var viewMain:NotesView = database.getView("main");
var viewMod:NotesView = database.createView("modified", "SELECT @All");
var col1:NotesViewColumn = viewMod.copyColumn(viewMain.getColumn(3), 1);
var col2:NotesViewColumn = viewMod.copyColumn(viewMain.getColumn(1), 2);
viewMod.removeColumn(); // remove default # column which is now last column
requestScope.status = "Columns in new view " + viewMod.getName();
var cols = viewMod.getColumns().iterator();
while (cols.hasNext()) {
var col:NotesViewColumn = cols.next();
requestScope.status += "\nColumn " + col.getPosition() + " = " + col.getTitle();
}