How to Configure Event Handlers in SyteLine
Event handlers in SyteLine provide a powerful mechanism for triggering automated actions when specific data changes or system events occur. Unlike form scripts that run client-side, event handlers execute on the server through the IDO layer, ensuring consistent behavior regardless of how data is modified. This guide covers configuring both IDO-level event handlers and application-level event subscriptions for comprehensive event-driven automation.
Understanding the SyteLine Event Model
SyteLine's event model operates at two levels: the IDO property level and the application event level. At the IDO level, events fire when properties are read, written, or when collection-level operations like Insert, Update, and Delete occur. These events follow a predictable sequence: Pre-event handlers execute before the operation, allowing validation and cancellation; the core operation executes; then Post-event handlers fire for follow-up processing. At the application level, SyteLine publishes events for major business operations like order entry, shipment confirmation, and inventory transactions. Configure event subscriptions through Application Development > Event Handlers to respond to these system-wide events.
- IDO property events include PropertyValueChanging (pre-change validation), PropertyValueChanged (post-change processing), and PropertyDefaulting (initial value assignment)
- Collection events follow Pre/Post patterns: PreInsert, PostInsert, PreUpdate, PostUpdate, PreDelete, PostDelete for complete lifecycle coverage
- Application events publish through the SyteLine event bus for operations like OrderEntry, ShipmentConfirm, InventoryAdjust, and POReceipt
- Navigate to Application Development > Event Handlers to configure event subscriptions with trigger conditions, actions, and notification rules
Implementing IDO-Level Event Handlers
IDO-level event handlers are implemented in IDO extension classes using C# method overrides and attribute decorations. Override the SetPropertyValue method in your extension class to intercept property changes and apply validation logic. Use the [IDOEventHandler] attribute to register methods as handlers for specific collection events like PreInsert or PostUpdate. Each handler receives an EventHandlerArgs parameter containing the current property values, the changed property name, and methods for setting error messages or canceling the operation. For optimal performance, implement early-exit conditions in your handlers to avoid unnecessary processing when the event is not relevant to your custom logic.
- Override SetPropertyValue in your IDO extension class to validate field changes, checking propertyName and applying business rules with error messaging
- Apply the [IDOEventHandler(IDOEventType.PreInsert)] attribute to methods that should execute before new records are committed to the database
- Use EventHandlerArgs.Cancel = true to prevent the operation from proceeding when validation fails, combined with a descriptive error message
- Implement early-exit conditions using if statements to check the changed property name before executing handler logic, reducing unnecessary processing
Configuring Application-Level Event Subscriptions
Application-level events in SyteLine can trigger external processes, notifications, and cross-module updates through the Event Handler configuration interface. Open Application Development > Event Handlers and create a new subscription by selecting the source event type and specifying the response action. Actions can include IDO method invocations, workflow triggers, email notifications, and external web service calls. Configure filter conditions to limit when the handler fires, such as only triggering for specific item types, customer groups, or order values above a threshold. Set the execution priority to control the order in which multiple handlers process the same event.
- Create event subscriptions in Application Development > Event Handlers by selecting the event source and defining the response action type
- Configure filter conditions using property expressions like ItemType = 'M' AND OrderAmount > 10000 to target specific business scenarios
- Set execution priority (1-99) to control handler ordering when multiple subscriptions respond to the same event, with lower numbers executing first
- Choose action types including InvokeIDOMethod, TriggerWorkflow, SendNotification, and CallWebService for flexible event-driven automation
Frequently Asked Questions
What is the difference between form scripts and event handlers in SyteLine?
Form scripts execute client-side in the Rich Client and only fire when users interact with forms. Event handlers execute server-side through the IDO layer and fire regardless of how data is modified, including API calls, imports, and workflow actions. Event handlers provide more reliable business rule enforcement since they cannot be bypassed by direct database access or alternative interfaces. Use form scripts for UI behavior and event handlers for business logic that must always execute.
How many event handlers can be active simultaneously in SyteLine?
SyteLine does not impose a hard limit on active event handlers, but performance considerations typically constrain implementations to 50-100 active handlers across the system. Each handler adds processing overhead of 5-50 milliseconds depending on complexity. Monitor the IDO performance counters to ensure total event handler processing time stays under 500 milliseconds per transaction. Organizations with more than 75 active handlers should conduct periodic performance audits.
Can event handlers be temporarily disabled without removing them?
Yes, SyteLine event handler subscriptions include an Active/Inactive status flag that allows handlers to be disabled without deleting the configuration. In the Event Handlers form, set the Status field to Inactive to suspend processing. For IDO extension class handlers, you can add a configuration parameter check at the beginning of the method to conditionally skip execution. This approach is useful during data migrations, troubleshooting, or when temporarily suspending business rules for bulk operations.
Key Takeaways
- 1Understanding the SyteLine Event Model: SyteLine's event model operates at two levels: the IDO property level and the application event level. At the IDO level, events fire when properties are read, written, or when collection-level operations like Insert, Update, and Delete occur.
- 2Implementing IDO-Level Event Handlers: IDO-level event handlers are implemented in IDO extension classes using C# method overrides and attribute decorations. Override the SetPropertyValue method in your extension class to intercept property changes and apply validation logic.
- 3Configuring Application-Level Event Subscriptions: Application-level events in SyteLine can trigger external processes, notifications, and cross-module updates through the Event Handler configuration interface. Open Application Development > Event Handlers and create a new subscription by selecting the source event type and specifying the response action.
Want to implement event-driven automation in your SyteLine environment? Netray specializes in SyteLine event handler design and IDO extension development.
Related Resources
How to Write SyteLine IDO Extension Classes
Learn how to write IDO extension classes in Infor SyteLine using C# and .NET to add custom business logic, validation rules, and data processing to your ERP system.
Infor SyteLineHow to Create SyteLine Custom Workflows
Learn how to create custom workflows in Infor SyteLine using the Workflow Designer, including approval routing, notifications, escalation rules, and integration triggers.
Infor SyteLineHow to Build SyteLine Form Scripts
Guide to building form scripts in Infor SyteLine using JavaScript-based scripting to add client-side validation, dynamic UI behavior, and custom calculations to ERP forms.