Skip to main content

On Edit

Last updated 24/03/2026

Overview

The On Edit event is a client-side event that executes when a form enters edit mode. This occurs either when the user clicks the Edit button in the form app bar or interacts with a field to begin making changes, allowing the application to respond as soon as editing begins.

How it Works

When the form enters edit mode:

  1. The current record is made editable on the client.
  2. The On Edit client-side event executes.
  3. The application can modify the form state.

Use Cases

  • Enable or disable specific fields based on conditions
  • Display messages or warnings when editing begins
  • Track when a record enters edit mode
  • Trigger client-side calculations or validations

Example

This function executes when a record enters edit mode, capturing the current date and time and storing it as an edit timestamp.

JavaScript
Set record edit timestamp
function onEditEvent(five, context, result) {
five.setVariable('RecordOnEditTimeStamp', Date().toLocaleString());
return five.success(result);
}