Ordering Event Handlers

When an event handler is first defined and saved, the system automatically assigns a handler sequence number. When the event handler is first saved, the system checks to see if there are other handlers associated with the named application event. Depending on the results of that check, the system then assigns 1 to the handler (if there are no other handlers associated with the event) or the next available integer (if there are other handlers associated with the event).

In general, then, if an application event uses multiple event handlers, by default, the system uses the handler sequence numbers to determine the order in which the handlers execute.

However, It is possible to indirectly alter this default order. This is done either by:

  • Using the Keep With and Chronology fields on the Event Handlers form
  • Moving your own adjacent event handlers up or down in the sequence by using the Event Handler Sequence form

To alter the default order in which event handlers execute using the Keep With and Chronology fields on the Event Handlers form:

  1. Optionally, from the Keep With drop-down list, select the event handler that you want to use as a reference point and anchor for the current handler.
    Note: This step is not required if you are using the First or Last option in the Chronology field.
  2. From the Chronology drop-down list, select the option that you want the current handler to use with respect to the handler you selected in Step 1.
    This table shows the list of options:
    Option Description
    First Executes the current handler before any other handlers
    Before Executes the current handler just before the referenced handler
    Instead Executes the current handler in place of the referenced handler. In this case, the referenced (original) handler does not execute at all
    Exclusively Instead Executes the current handler instead of the referenced handler and any other handler that may be referenced to execute instead of (Instead) that same handler
    After Executes the current handler after the referenced handler
    Last Executes the current handler after all other handlers