Skip to main content
Version: 0.43

On After Data Load

This event fires once a form has finished loading its data and applying it to the fields. Use it to run logic that depends on the record being fully loaded - for example, showing a summary message, or triggering a follow-up fetch based on the loaded record.

On Data Loaded


When It Fires

The event runs after the form's data has been fetched and applied to the fields, so data already reflects the loaded record. It fires each time the form (re)loads its data - for example when the form first opens, and again if it reloads with different form arguments.

A companion On Before Data Load event fires just before loading starts, if you need logic to run beforehand instead.


Available Variables

The function is declared async, so you can safely await inside it. This is a form-level lifecycle setting rather than a component Event, so its variables differ from the standard component-event set: it does not receive mode or event, but it does add a few form-specific ones.

VariableWhat it gives you
dataThe form's current data, now populated with the loaded record
initialValuesThe values the form had when it was first loaded, as a fixed snapshot
parentFormValuesThe field values of the parent form, if this form is open as a dialog opened from another form
formThe form instance
globalState / setGlobalStateThe global application state, and a function to update it
pageContextThe current Page Context
applicationThe Application API object
httpAn Axios instance for making HTTP requests
messageFunctions to show toast notifications
momentThe Moment.js library
queryThe form's query-string parameters

Form type to use: Edit Form or Details View - any form type that loads an existing record.

Example - Show a toast naming the record just loaded:

message.info(`Viewing invoice ${data.invoiceNumber}`);