Form Events
Last updated
Last updated
The Form Events
block is used to handle various events related to a form.
This block only works when used in Form type pages. See Working With Forms to learn about how forms work.
The block consists of Init Tasks, Pre-Validate Tasks, Post-Validate Tasks, Submit Tasks, Success Tasks and Error Tasks flow parameters which are discussed below.
The Init Tasks flow parameter, is used to implement logic during the initialization process of the form.
If you plan on adding logic that takes time to complete (i.e. executes in the background), we recommend locking the form using the Lock/Unlock Form block and unlocking when the task is complete.
The logic in the Pre-Validate Tasks flow parameter is invoked after the user clicks the submit button or when the Save Form with Data is executed without a valid data object attached its value parameter. This occurs prior to Zingy's automatic field input validation process.
You can implement any supplemental validation or input correction tasks here.
Use the Get Field Input Value or Get Input Value blocks to retrieve the values entered by the user.
For any input corrections use the Set Field Input Value or Set Input Value blocks to set the value.
Use the Set Form Event Status block by setting its Dropdown configuration setting to OK for continuing with the processing, or ERROR to stop further processing.
You may also use the Set Form Event Status Message to report any specific error message to the user.
Please note that you cannot execute a background task and wait for it's completion here.
The logic in the Post-Validate Tasks flow parameter is invoked after Zingy's automatic field input validation process but prior to the submission of the form's data.
To access the data entered by the user, use the Form Data block for both retrieving and setting the values of the fields. At this stage, avoid using the Set Field Input Value or Set Input Value blocks since the system has already progressed beyond the point of reading field input values.
Use the Set Form Event Status block by setting its Dropdown configuration setting to OK for continuing with the processing, or ERROR to stop further processing.
You may also use the Set Form Event Status Message to report any specific error message to the user.
Please note that you cannot execute a background task and wait for it's completion here.
The logic in the Submit Tasks flow parameter is invoked only in the case of custom forms (where no database table is attached).
Implement your own form data submission or processing logic here. You can access the form's data using the Form Data block.
Once you are done processing or submitting the data, use the Form Submit Complete block for the system to proceed with the next step.
Refer to the Form Submit Complete block for an example.
The Success Tasks flow parameter allows you to execute logic when the form's data has been submitted successfully.
You can use the Form Data block to retrieve the data that was submitted.
You may also use the Set Form Event Status Message to report any specific message to the user. This will override the form's success message.
Please note that you cannot execute a background task and wait for it's completion here.
The Error Tasks flow parameter allows you to execute logic when there was an error in submitting the form's data.
You can use the Form Data block to retrieve the data entered by the user..
You may also use the Set Form Event Status Message to report any specific message to the user. This will override the form's error message.