Creating an Event Handler
After you create an operation, the next step is to create an event handler to bind the operation.
To create an event handler:
1. In Max Designer, on the Developer Tools () launchpad menu, expand the Development Tools section and click Event Handlers, and then in the list view, in the top left corner, click Create ().
2. Complete the fields as follows, and then in the top left corner, click Save ().
Field
Description
Name
The name for the event handler, for example, Shopping Event Handler.
Operation
The operation you want to execute with this event handler, for example, Shopping Operation.
Trigger
Specify whether the event handler should be triggered before or after originating operation execution. For CRUD originating operations, when set to Before, the event handler runs after operation execution and before records created or updated by the associated transaction are committed to the database. When set to After for CRUD originating operations, the event handler runs after each associated transaction is committed to the database.
Action On Failure
Specify the action to take if the event handler fails. Ignore Failure is the default, and when set, failures are ignored, and remaining event handers continue to run. When set to Fail, all event handlers stop and return a failure error.
Event Trigger Context
One or more contexts for which an event handler is to be triggered, for example, Package Import and Runtime.
* 
In the Event Trigger Context field, be sure to select Package Import and Runtime so that when you use the Groovy API to create records, the relevant event handler is properly triggered.
3. On the Originators tab, in the top left corner, click Link (), and then in the Link Related Operations list, link the Create Shopping Item operation.
4. On the record page, in the top left corner, click Save and Close (), and then on the Development Actions () launchpad menu, click Synchronize.
* 
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 Max instance, use Object Designer to navigate to the How-to Topics list view.
For more information:
Was this helpful?