OpenView @Command (Formula Language)

Opens the specified view in the current database.

Syntax

@Command( [OpenView] ; viewName ; key ; newinstance )

Parameters

viewName

Text. Optional. The name of the view you want to open. If you omit the view name, the database opens to its default view; or, if the user has opened the database before, to the last view used by that person. If the database is already open to the specified view, Notes/Domino makes that the first window.

key

Text. Optional. Indicates which document you want Notes/Domino to scroll to when it opens viewName. The key is a value that appears in the first sorted column of viewName. If you omit the key, no document is selected.

newinstance

Number. Optional. Specify "1" if you want the view to open in a new window, even if there's already a window open for the database. If you omit this parameter, the new window is opened only when it's actually needed.

Note: The view must be sorted in order for the key to work; otherwise, no document is selected when the view opens. The key column must be the first sorted column when multiple sorted columns are present.

Usage

You can use this command in Web applications.

If you specify the newinstance parameter for @Command([OpenView]), the @SetTargetFrame function is ignored.

If you do not specify a viewName then the last view is the one that will open in the specified targetframe of @SetTargetFrame.

To open a view that is embedded on a page or form, use @Command([OpenPage]) or @Command([OpenDocument]) respectively.

Examples

  1. This formula opens the Reverse Chronology view for the current database.
    @Command([OpenView]; "Reverse Chronology") 
  2. This code, when added to as the formula for an action button on a form, opens the Managers Only view of the current database if the current user has Manager level access in the ACL. Otherwise, it opens the Employees view.
    @If(@UserAccess(@DbName) = "6";@Command([OpenView];"Managers Only");@Command([OpenView];"Employees"))