Introduction
Last updated 19/03/2026
Events in Five
In Five, events define points in the application where custom logic can run. They allow you to execute functions in response to specific actions or processes.
Functions are not automatically tied to events, you need to explicitly choose which event a function is attached to.
Five has two types of events, On events and Do Events.
On Events (Client-Side)
On events run in the browser and are triggered by user interaction with the interface. These events are used to respond to actions such as selecting a record, opening a form, or modifying a field value.
On events provide immediate feedback and updates in the UI. They do not directly modify the database, but they control what the user sees and how the interface behaves.
Do Events (Server-Side)
Do events run on the server and are triggered during backend processes, such as creating, updating, or deleting records.
They provide defined points where logic can process or validate data, enforce business rules, or record system activity. Because they run on the server, Do events ensure that important operations are handled consistently and securely.
Functions and Event Assignment
Functions contain the logic that executes when an event occurs. By attaching a function to a specific event, you control what happens at that point.
Events define when something can happen, while functions define what actually happens. This ensures the custom logic only runs where it is needed.
How Events Work Togther
On events and Do events can be used together to handle both interface interactions and data processing. An On event can respond instantly to a user action in the UI, then call a Do event to process the associated data on the server. This approach keeps the interface responsive while ensuring backend operations are applied consistently.