On Logon
Last updated 14/04/2026
Overview
The On Logon event is a client-side event that executes when a user clicks the Sign In button and the server has successfully authenticated the user. It runs immediately after a valid login, allowing the application to perform front-end logic such as preparing the user interface, loading user-specific data, or triggering post-login actions.
How it Works
When a user attempts to sign in:
- The user enters their credentials and clicks the Sign In button.
- The server validates the credentials and confirms the user is authenticated.
- Once authentication is successful, the On Logon event executes on the client.
- Any associated client-side logic runs instantly, enabling the application to respond to the authenticated session.
Use Cases
- Loading user-specific preferences or settings
- Displaying welcome messages
- Initializing client-side data or UI components based on the user role
Example
This function executes during the customer logon process when a user successfully signs in, and it filters data so the user can only access records linked to their own
EntityKey
before
returning a successful result.
Customer logon data access filter
function CustomerLogon(five, context, result) {
//Setting EntityKey to the five.currentUserRecordKey());
five.addFilter('Entity.EntityKey', five.currentUserRecordKey());
return five.success(result);
}