ManagedForm.BeforeClose

Syntax:

BeforeClose(<Cancel>, <Exit>, <WarningText>, <StandardProcessing>)

Parameters:

<Cancel>

Type: Boolean.
Indicates that object writing is cancelled. If you set this parameter to True in the body of the handler procedure, the object will not be written.
Default value: False.

<Exit>

Type: Boolean.
The attribute indicating the form closing during the process of application shutdown is transferred to this parameter:
  • True - if in the process of application shutdown; False - if only the form closes.

<WarningText>

Type: String.
If the parameter <Cancel> has been set value True and <WarningText> contains a non-empty string, then:
  • if <Shutdown> has been set to True, the message window with a warning text string is displayed and the user is prompted to stay or exit the window without saving changes.
  • if <Shutdown> has been set to False, warning text is ignored and the process of form closing is aborted.
If the parameter <Cancel> has been set value True and <WarningText> contains an empty string, then:
  • if <Shutdown> has been set to True, a message window with a general text " Work is not complete in this window" is displayed and the user is prompted to stay or exit the window without saving changes.
  • if <Shutdown> has been set to False, the parameter value <WarningText> is ignored, and the process of application shutdown will be continued.
If the parameter <Cancel> has been set value False, the parameter value <WarningText> is ignored, and the process of application shutdown will be continued.
Note: In Mozilla Firefox web browser the message window contains no warning text.

<StandardProcessing>

Type: Boolean.
This parameter passes a flag indicating whether standard (system) processing of the event is performed. If in the body of handler procedure a value of this parameter is set to False, standard generation of task list will not be executed.
Default value: True.

Description:

Occurs on the client before closing a form, or when a modal form is closed by timeout. In the event handler, it is possible to cancel both the form closing and the standard on-close processing.
In the process of application shutdown (parameter Exit has a value True) server calls and opening windows are not allowed.

Note:

When form is closed by timeout, if closing was cancelled in the handler, then second closing will be initiated after the same period of time.
In the web-client mode when the form, opened in the auxiliary windows, is closed by system Close window button (a cross in the upper right form corner) or by pressing Alt+F4. the handler is not called.

    

1C:Enterprise Developer's Community