On Complete
Last updated 25/03/2026
Overview
The On Complete event is a client-side event that executes when the Save button is clicked on a top-level form. It runs immediately before the form data is sent to the server, allowing the application to respond at the final stage of the user's interaction.
How it Works
When the Save button is clicked:
- The user completes their input on the form and clicks the Save button.
- The On Complete client-side event executes in the browser.
- The application can validate the data before it is submitted to the server.
- If successful, the data is then sent to the server for processing and storage.
Use Cases
- Perform final client-side validations before submission
- Prevent submission if certain conditions are not met
Example
This function executes when the Save button is clicked, and logs the last name and the first name to the Five Inspector.
Log last name and first name to the Five Inspector when the save button is clicked
function onCompleteEvent(five, context, result) {
five.log(`Customer ${five.field.LastName}, ${five.field.FirstName} saved.`);
return five.success();
}