Working With Event Handlers
Event Handlers implement customization logic as Operation-Source pairs that are called when events are fired. You can create Event Handlers for any type of event. If the Event Handler originator is a REST Operation or Generic Operation, you define a Before Operation or After Operation Event Handler, and if the originator is a CUD Operation, you define a CUD Event Handler.
Field | Description |
---|
Name | Name for the Event Handler. |
Operation | The Operation record that defines the logic implementation for this Event Handler. |
Handling | This value is always Server for Event Handlers that are available for customization. |
Trigger | Before or After. |
Action on Failure | Action to take if the Event Handler fails. When set to the default value of Ignore Failure, execution continues, and modified information is committed to the database. When set to Fail, execution halts and returns with a failure, and no modified information is committed. |
Batch | Specifies whether the Event Handler receives one call per each entry or a single batch call for all applicable entities in the triggering transaction. |
Event Trigger Context | Specifies the context for which Event Handlers are triggered: Runtime (default), Package Import, or Tenant Customization Import. Multiple values can be specified. |
Originators tab | Contains a list of related operations that act as originators of the event record that triggers execution for this Event Handler. |
In the Originators tab, you can see whether an Event Handler is an Operation Event Handler or CUD Event Handler record. For example, in the following Event Handler record, the Create Source template operation for the Source object is listed in the Originators tab, which means this is a CUD Event Handler record.
The following Event Handler record has three different originators, all of which are CUD operations that invoke the same Event Handler.
The following Event Handler record has four originators, none of which are create/update/delete operations, which means this is an Operation Event Handler record. Because the Trigger field is set to After, the handler is executed after each of its originators execute.
To implement an Event Handler, you first define at least one Source record and implement its logic. Next, you define one or more Operation records for the source and synchronize data. Finally, you define an Event Handler record and synchronize data to complete the implementation.
| For more information on Event Handlers, see the Max how-to topic How to extend a CRUD operation with an event handler? To view this topic, in your sandbox instance, use Object Designer to navigate to the How-to Topics list view. |
For more information: