operation cleanup

Defines the component behavior when a component instance is removed.

operation cleanup
   {variablesBlock}
   Your code here ...
end

Return Values

The return values of cleanup have no effect on further processing.

Use

All components.

Description

If defined, the cleanup operation is automatically executed as the instance is removed, which can occur in the following circumstances:

  • When a component instance is removed explicitly with deleteinstance.
  • When a component instance is automatically removed by the successful completion of an Accept or Quit trigger in a form activated by an edit statement without switches in the exec operation. (This occurs because there is an implicit exit after the edit in the exec operation.)

    Note:  Completion of an accept or auit operation does not remove the form instance if it was activated by edit/modal, edit/nonmodal, or show (in an operation). Only the visual representation of the form is removed.

  • When an exit is encountered in an operation.
  • When an exit is encountered in the parent component. In this case, the cleanup operation of all child components is activated.
  • When the cleanup operation is explicitly referenced in an activate statement.

Because the instance being deleted no longer exists at this point, the cleanup operation should not perform any action that involves its own instance. For example, it should not use deleteinstance on the instance or activate for an operation contained in the instance.

Related Topics