Event Handlers

Page ID: (AU201070)

You use this page to create and modify event handlers for a particular screen (that is, a form in MYOB Acumatica).

The page automatically displays the event handlers added in the predefined workflow.

Tip: You open the Event Handlers page by clicking Event Handlers under the screen ID (of the form for which you are adding or modifying event handlers) in the navigation pane of the Customization Project Editor. In the name that appears on the page, Event Handlers is preceded by the form ID and then the form name in parentheses.

Page Toolbar and More Menu

The page toolbar includes standard buttons and page-specific buttons and commands. For the list of standard buttons, see Page Toolbar. The page-specific commands can be shown as buttons on the page toolbar, as commands on the More menu, or in both places. These commands are listed in the following table in alphabetical order.

Command Description
Revert Changes

Returns the selected event handler to its predefined state.

View Changes

Opens the Changes dialog box, in which you can view the description of the selected event handler in JSON format. If any changes were applied to a predefined event handler, they are highlighted in the dialog box. You can return the event handler to the predefined state by clicking Revert Changes in the Changes dialog box.

Tip: The command is available only if the event handler is inherited—that is, based on a predefined event handlers.
Table 1. Changes Dialog BoxYou use this dialog box to view the source code of the event handler; the changes are highlighted in red. The dialog box also contains the following buttons.
Button Description
Revert Changes

Returns the event handler to the predefined state.

Close

Closes the dialog box.

Event Handler Properties Dialog Box

This dialog box opens when you click Add New Record on the page toolbar, or when you click the link in the Handler Name column in the table on the page. The list of properties may differ depending on the event handler.

Table 2. Event Handler Properties Dialog Box: Summary AreaThe Summary area of this dialog box has the following elements.
Element Description
Handler Name

The system name of the event handler.

Display Name

The name of the event handler that is displayed in the diagram view of the workflow (see Workflow (Diagram View) for details).

Event Source

The source object for the event handler. This is the DAC for which the event is raised.

This box is displayed if the value in the Event Type box is Triggered from Code.

Event Name

The name of the event that needs to be handled.

This box is displayed if the value in the Event Type box is Triggered from Code.

Event Type

The type of event for which the event handler is created or modified.

This box is read-only if you are modifying an existing event handler. The box can contain one of the following options:

  • Triggered by Field Change
  • Triggered from Code
Field Name

The names of the fields whose change triggers the event.

You can select one field or multiple fields.

This box is displayed if the option in the Event Type box is Triggered by Field Change.

Table 3. Event Handler Properties Dialog Box: Entity to Apply Workflow SectionIn this section, you specify how to get the object for which the workflow should be used.
Element Description
Object from Event

A check box that indicates (if selected) that the system should use the primary data view of the graph where the event has been raised.

This check box is available only if the DAC on which the event is raised is the same as the primary DAC of the current graph.

Parameter from Event

A check box that indicates (if selected) that the system should use the view that has been transferred as the event parameter.

This check box is available only if the type of the parameter returned by the event coincides with the primary DAC of the current graph.

View from Graph

A check box that indicates (if selected) that the system should use the view from the graph for the event handler.

This check box is available only if the event handler is predefined and if the code for the event handler contains the BQL for obtaining the entity for which the workflow should be used.

Allow Multiple Entities

A check box that indicates (if selected) that the workflow can be used for multiple entities if the BQL has returned multiple entities. If the check box is cleared, the workflow is used for only the first entity.

This check box is available only if the event handler is predefined and if the code for the event handler contains the BQL for obtaining the entity for which the workflow should be used.

Table 4. Event Handler Properties Dialog Box: Field Update TabIn the table on the Field Update tab, you add the fields that should be updated after the event is processed. The fields are updated in the order in which you add them to the table. You can change the order of the listed rows (and thus the corresponding fields) by clicking the row you want to move and then clicking Move Up or Move Down on the table toolbar.

The table toolbar includes only standard buttons. For the list of standard buttons, see Table Toolbar.

The table contains the following columns.

Column Description
Active

A check box that indicates (if selected) that the field should be updated after the event is processed.

Field

The name of the field that should be updated.

From Schema

A check box that indicates (if selected) that field value from the database should be used.

New Value

The new value to be used for the field.

Status

The status of the field update.

Table 5. Event Handler Properties Dialog Box: ButtonsThis dialog box has the following buttons.
Button Description
OK

Closes the dialog box and applies the changes.

Cancel

Closes the dialog box without applying any changes.

Table

This table contains the list of event handlers and the basic settings of each of them. The columns of the table are described below.

Column Description
Handler Name

The internal name of the event handler.

If you click the name, the Event Handler Properties dialog box is opened, which shows the properties of the selected event handler.

Display Name

The name of the event handler that will be displayed on the Workflow (Diagram View) and Workflow (Tree View) pages.

Event Type

The type of the event handler.

This column can contain one of the following options:

  • Triggered by Field Change: The event that is triggered by field changes on the UI
  • Triggered from Code: The event that is triggered from code.
Event Source

The source object for the event handler. This is the DAC for which the event is raised.

Event Name/Field Name

The name of the event that needs to be handled or the names of the fields whose change triggers the event, depending on the value in the Event Type column.

Status

The status of the event handler.

The status of the event handler can be one of the following:

  • Inherited: A system event handler that has not been modified
  • New: An event handler that has been created in the customization project
  • Modified: A system event handler that has been modified in the customization project