Events Overview
Events let a function react automatically when something happens to one of its records. A function that supports events publishes a fixed set of event names (for example OnTaskStarted for work orders or OnCreated for material transactions). In the Function Designer you can bind an action to each of these events: a short expression that runs at the moment the event occurs, for example to move a work order to another state or to send a material transaction to an ERP system.
Event bindings are managed per function from Administration > Function Designs, with the Events row action of the function. The action is shown only for functions that publish events.
Event actions run inside the user's own operation (starting a task, saving a transaction). They have no separate approval step, so a binding changes the behavior of the function for every user of the tenant as soon as it is saved.
Purposes of Events
- Automating routine state changes, such as moving a work order to In Progress when work starts on one of its tasks.
- Starting outbound (push) integrations when a record is created or updated, for example sending material transactions to an ERP system.
- Applying a condition before the automatic step, so that it runs only for the records that need it.
- Replacing the default automatic behavior delivered with the product with the organization's own rule.
How Events Work
- A user performs an operation on a record, for example starts a task of a work order.
- After the record is saved, the function raises the related event.
- The system looks up the action bound to that event for the function. If there is none, nothing else happens.
- The action expression is evaluated. The simple fields of the record (texts, numbers, dates, identifiers, yes/no values) are available in the expression as variables, and the helper functions of the function (such as
WorkOrderChangeState) can be called.
Functions and Events That Support Bindings
| Function | Event | When it occurs |
|---|---|---|
| Work Order | OnTaskStarted | After a user starts work on a task of the work order. |
| Work Order | OnTaskCompleted | After a user completes a task of the work order. |
| Material Transaction | OnCreated | After a material transaction is created. |
| Material Transaction | OnUpdated | After a material transaction is updated. |
Other functions do not publish events, so the Events row action does not appear for them.
Default Bindings
- Work Order: Delivered with two bindings:
OnTaskStartedrunsWorkOrderChangeState("InProgress", "InProgress"), so the work order moves to In Progress when work starts on a task.OnTaskCompletedrunsWorkOrderChangeStateIfAllTasksCompleted("Completed", "Completed"), so the work order moves to Completed when all of its tasks are completed.
- Material Transaction: Delivered without bindings. The
OnCreatedandOnUpdatedevents are available, but nothing is sent anywhere until an administrator binds an action, for examplePushMaterialTransactionToErp("<integration name>").
As long as the Work Order bindings have never been changed by a user, a system update may refresh them to the delivered version. Once you edit them, your version is kept.
Event Operations
The event listing page provides standard functions such as filtering and searching. These functionalities are detailed under General System Usage.
The Events page lists the bindings of the function with the Action and Event Name columns. Both columns can be searched and filtered. Each row has Edit and Delete actions, and the New button adds a binding. Creating, editing and the available action functions are described in Creating an Event Binding.
Authorization and Access Control
Topics related to authorization and access control are detailed under User Management and Authorization.
- Update a Function Design: Required to see the Events row action on the function list and to create, edit or delete event bindings.
- Function Designer: Required to open the Function Designer and to load the list of event names of a function.
The action itself runs as part of the user operation that raised the event. Changes it makes (for example a state change) are made by the system on behalf of that operation.
User Tips and Best Practices
- One Binding per Event: When an event occurs, only the first binding found for that event is run. Keep a single binding per event and combine the logic in its expression if needed.
- Test in a Test Tenant: An action that fails stops the user operation that raised the event; check new expressions in a test environment first.
- Document Your Bindings: Record why each binding exists and which integration it uses, so that the automatic behavior stays understandable.
- Keep Integration Names in Sync: A push action refers to the integration by its name. If the integration is renamed, update the binding too.
Frequently Asked Questions
Why Don't I See the Events Action for a Function?
Only functions that publish events (currently Work Order and Material Transaction) have the Events action. You also need the Update a Function Design permission.
Can I Turn Off the Automatic Work Order State Changes?
Yes. Delete the OnTaskStarted or OnTaskCompleted binding of the Work Order function, or replace its action with your own expression.
What Happens if the Action Fails?
The error is logged and the user operation that raised the event fails, so the user sees an error. Fix or remove the binding to restore normal operation.
Where Can I See the Result of a Push Action?
PushMaterialTransactionToErp only queues the transaction for sending. The result of the transfer is shown in the work history of the integration, described under Integrations.