Opening and Closing Windows

Windows need to be specifically opened from a script. This is done by a call to one of the following:

ModalWindow()Displays the window with the given id. The window will be modal. It should have an OK (Default) button and a Cancel button. If it lacks at least one of these, then it will have a close box to dismiss it. For example:

        let last_item = modalWindow("my_window")

Will open the window you name "my_window" as a modal window.

You will typically write a `Before` handler for your window that will set the values of fields and controls (using `SetFieldValue`), and an `After` handler to collect any changed values.

The ModalWindow function will not return until the window is closed by the user clicking OK or Cancel. The return value will be the symbolic name of the last item hit (usually "B_CANCEL" or "B_OK").

CreateWindow()Similar to ModalWindow, but displays the window modelessly.

CreateListWindow()Opens a list window (similar to the Names or Product lists) in which you can display selected records from a MoneyWorks table.

ModalListWindow()The same as CreateListWindow, except the window opened is modal (so it has to be closed before you access other parts of MoneyWorks).

To close a window, use CloseWindow(). Modal windows will close automatically when either the Default (OK) or Cancel button is clicked.

To activate a window that may have gone into the background use SelectWindow()—if possible, the window will be brought to the front.