Creating Event Handlers

In its most basic form, an event handler consists of these parts:

  • An association with a particular application event
  • A handler sequence number
  • One or more actions to perform when the application event is triggered

Each event handler is uniquely defined in the system by the combination of an event name and a handler sequence number. Both of these are set on the Event Handlers form. Event handlers must have one or more associated event actions.

To create an event handler:

  1. Open the Event Handlers form.
  2. Click Filter-in-Place or press F3.
  3. Select Actions > New.
  4. In the Event Name field, select an existing application event or specify a new event name for the handler that you want to define.
  5. Specify a description for the handler. This description is helpful when you have multiple handlers with the same event name. This description allows you to find the appropriate handler in a list.
  6. Optionally, use the Keep With and Chronology fields to control the handler sequence with respect to other developers' handlers.
  7. Save the new event handler.
  8. Click Event Actions to open the Event Actions form.
  9. Create the actions to be performed when this event handler is executed.
  10. Save your changes.
  11. Close the Event Actions form.
  12. On the Event Handlers form, set the other options as desired. For information about these options, see the online help for each option.
  13. To see a graphical (diagrammatic) representation of the event handler and its actions, click Diagram. This button opens the Event Handler Diagram form. This form allows you to edit and add event actions to the event handler flow.
  14. Save the event handler.
Note: Application events and event handlers are defined for an application database and not a particular site. To restrict an event handler to only run at certain sites on a database, on the Event Handlers form, specify the sites in the Applies To Sites field.