Skip to main content

Introduction to Form Events

Last updated 8/11/2021

Five's Form Events

You can add functionality to your forms by generating events written in custom code for form submissions, sub-form submissions, on creation, and more. The custom code can be triggered server-side that will run on the server, or client-side that will occur in the browser to allow more interactivity by immediatley responding to your end-users actions as they don't require a round trip to the server.

The following serves as an overview of the types of events that can be attached to a form.

Event NameServer/Client EventEvent Fires
DoCreateServerEvent fires when the Save button is clicked for a new record.
OnSelectionClientEvent fires when selecting an existing record from the list.
OnShowClientEvent fires when a record selected from the list is shown.
OnAddClientEvent fires when the Add Item button is clicked.
OnEditClientEvent fires when the form enters edit mode.
OnCancelClientEvent fires when the Cancel button is clicked.
OnSubFormCompleteClientEvent fires when the Save button is clicked on a sub-form.
OnCompleteClientEvent fires when the Save button is clicked.
DoCompleteServerEvent fires when the Save button is clicked.

Add an Event to a Form

Prerequisite

The function must be coded in the Functions view.

Steps

  1. Select Forms in the menu.
  2. Click the Add Item button in the list app bar.
  3. Fill in the required details on the General page.
  4. Click the Events tab.
Add a New Form
Figure 1 - Add a new form

  1. Use the lookup icon in the required event field and select the Function ID.
  2. Add at least one page and one field to your form.
Add an Event to a Form
Figure 2 - Add an event to a new form

  1. Click all three Save buttons in the stacked form app bars.
Save the form
Figure 3 - Save the form

Edit a Form to Add an Event

Prerequisite

The function must be coded in the Functions view.

Steps

  1. Select Forms in the menu.
  2. Select the required form record in the list.
  3. Click the Events tab.
Add an Event to a Saved Form
Figure 4 - Edit a saved record to add an event

  1. Click the Edit button in the form app bar.
Edit the Form
Figure 5 - Edit button

  1. Use the lookup icon in the required event field and select the Function ID.
  2. Click the Save button in the form app bar.
Attach the Function and Save the Form
Figure 6 - Attach the Function and save the form