DialogBox (NotesUIWorkspace - LotusScript®)

Brings up a dialog box that displays the current document (either open or selected in a view) or a specified document using a form you specify. The dialog box shares fields with the underlying document. The user interacts with the dialog box as usual, clicking OK or Cancel when finished.

This function can be used with any form, but it's particularly useful with forms that contain a single layout region or table, because the user can interact with the layout region or table as if it were a dialog box.

Defined in

NotesUIWorkspace

Syntax

flag = notesUIWorkspace .DialogBox( form$ , [autoHorzFit] , [autoVertFit] , [noCancel] , [noNewFields] , [noFieldUpdate] , [readOnly] , [title$] , [notesDocument] , [sizeToTable] , [noOkCancel] , [okCancelAtBottom] )

Parameters

form$

String. The name of the form.

autoHorzFit

Boolean. Optional. Specify True to scale the dialog box horizontally to fit the first layout region or table on the form. Otherwise, the dialog box is not scaled horizontally.

autoVertFit

Boolean. Optional. Specify True to scale the dialog box vertically to fit the first layout layout region or table on the form. Otherwise, the dialog box is not scaled vertically.

noCancel

Boolean. Optional. Specify True to not display the Cancel button. Otherwise, the dialog box contains the Cancel button.

noNewFields

Boolean. Optional. Specify True to not add fields that are on the dialog box form but not already contained in the underlying document. Otherwise, all dialog box fields are passed to the underlying document.

noFieldUpdate

Boolean. Optional. Specify True to not pass any edits from the dialog box to the underlying document (for example, if you're passing the edits somewhere else in a Queryclose script for the dialog box form). Otherwise, the edits are passed to the underlying document.

readOnly

Boolean. Optional. Specify True to prohibit writing to the dialog box (for example, if you are using the dialog box to display a help screen). Otherwise, the dialog box is read-write. This option makes noCancel true.

title$

String. Optional. A title for the dialog box. Defaults to "Notes®."

notesDocument

NotesDocument. Optional. A document to be opened instead of the current document.

sizeToTable

Note: This parameter is new with Release 5.

Boolean. Optional. Specify True to apply autoHorzFit and autoVertFit to the first table on the form. Otherwise, they are applied to the first layout region on the form.

noOkCancel

Note: This parameter is new with Release 5.

Boolean. Optional. Specify True to not display the OK button. Otherwise, the dialog box contains the OK button. Using this parameter prevents any changes made in the dialog box from being reflected in the current document. Use the RefreshParentNote method if you want changes to be reflected in the current document but don't want an Ok button to display.

okCancelAtBottom

Note: This parameter is new with Release 6.

Boolean. Optional. Specify True to display the OK and/or Cancel buttons side-by-side at the end of the dialog box. If you specify False or omit this parameter, the buttons appear stacked at the beginning.

Return value

flag

Boolean. Returns True if the user clicks OK in the dialog box. Returns False if the user clicks Cancel.

Usage

The autoHorzFit and autoVertFit parameters allow you to display an entire layout region (sizeToTable is False) or table (sizeToTable is True) in a dialog box without displaying the rest of the form. If the form has more than one layout region or table, the first is used. For best results:

  • Use both autoHorzFit and autoVertFit.
  • In the Layout properties box, deselect "Show border" and select "3D style."

If autoHorzFit and autoVertFit are both False, the entire form is used and no sizing takes place. If the form contains no layout region (sizeToTable is False) or table (sizeToTable is True), the entire form is used and no sizing takes place.

Sharing of field values

This method displays the current or specified document using a different form. This means:

  • If the form has field names in common with the document, the field values of the document are displayed in the dialog box.
  • If the user changes the value of any fields in the dialog box and clicks OK, the changes are reflected in the same fields on the document.
  • If the user enters a value for a field in the dialog box, and the document does not contain a field by that name, the value is added to the document, even if it is not displayed in the form, unless noNewFields is True.

Field sharing is not supported for rich text fields.

Example