Make your application more powerful and dynamic by adding complex logic to your forms with the help of Deluge Scripting, the in-built scripting language supported by Zoho Creator. The Deluge Script Builder provides a drag-and-drop user interface to add form/field action scripts. It can be invoked from the form header by selecting More Actions or by directly selecting the Script tab. You can configure the following action scripts to your form, when a new record is added or when an existing record is edited/deleted.
- On load scripts that are executed when the form is loaded for adding or editing a record. For example, set a date field in the form with the current date or to hide a field when the form is loaded.
- Validate scripts that are executed when a new record is submitted or when an existing record is modified and submitted or when an existing record is deleted. For example, check if a field value falls within a specified range, restrict the number of registrations to your form etc.
- On success scripts that are executed when a new record is successfully submitted to the database or when an existing record is updated or deleted from the database. For example, send a mail to the admin user_id when a record is deleted.
Refer the section Quick Start Guide -> Configure Form Actions to learn more about the steps in configuring the above scripts using Script Builder.
Steps to configure action scripts from your Form
- Select the Form from the FormsTab.
- Select More Actions -> Script (on Add) -> Actions on Load, to perform actions when the form is displayed to add a new record.
- Select More Actions -> Script (on Add) -> Validate on Form Submit, to perform form validations, before data is persisted.
- Select More Actions -> Script (on Add) -> Actions on Success, to perform form actions after the data is persisted.
Similarly you can use the Script (on Edit) option to configure Form actions when an existing record is edited and the Script (on Delete) option to configure actions when a record is deleted. Selecting the above options will display the Script Builder to configure the required actions.
Refer the section Deluge Reference -> Form Actions - DB Forms to learn more about each form action.