CloseWindow @Command (Formula Language)

Same as the File - Close command menu. Closes the current Notes® tab, or the window if this was the last tab in the window. If the document or design element in that window has not been saved, Notes® prompts the user to save it before closing.

Note: This command is new with Release 6.

Syntax

@Command( [CloseWindow] )

Usage

CloseWindow does not close any Notes® workspace window that cannot be closed manually.

When using this command on a form in Notes®, to prevent the user from being prompted to save any changes, either save the document first, or use the statement FIELD SaveOptions := "0"; before this command to exit without saving.

You can use this command with Web applications, as long as you enable the "Allow Javascript on the Web" setting on the Basics tab of the Database Properties box. Precede this command with @Command([FileSave]) to simulate a Submit button using the following format @If(@Command([FileSave]); @Command([CloseWindow]); "")

Examples

  1. This code, when added to an action button on a form and accessed from a Web application, saves and closes the current document and opens the Results view. Following CloseWindow with the OpenView @command prevents the default Form Processed page from displaying and instead brings the user to the specified view.
    @Command([FileSave]);
    @Command([CloseWindow]);
    @Command([OpenView];"Results")