Skip to main content

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:

  1. The user enters their credentials and clicks the Sign In button.
  2. The server validates the credentials and confirms the user is authenticated.
  3. Once authentication is successful, the On Logon event executes on the client.
  4. 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.

JavaScript
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);
}