The Deluge Script Builder provides a drag-and-drop user interface to add form/field action scripts, create reports with complex criteria/filters and define functions that can be reused from elsewhere in scripting. It enables you to transfer complex application logic into deluge code, without the need to learn or remember the Deluge syntax and functions. It helps in creating Deluge action scripts quickly, without any errors.
To invoke Script Builder from the Form,
To invoke Script Builder directly,
The basic steps involved in creating a form/field action script using the script builder is given below:
Select the Form. By default, the script builder displays the form selected in the Dashboard page. To select a different form, use the form drop-down list displayed next to the Functions tab.
The Form Actions lists the on load, validate and on success form actions that invoke a script execution. For example, to invoke a validation script that validates form data before submitting it to the database, select Form Actions -> on add -> Validate. Refer the topic Form actions for more information on each form and field actions supported by Deluge.
The Field Actions lists the on user input and on update actions for each field in the selected form, that invoke a script execution. For example, to invoke a script when you change the value of a field in the form, select Field Actions -> <Field_Name> -> On user input. Refer the topic Field Actions, for more information on each form and field actions supported by Deluge.
The script builder displays the tasks/statements that can be used to perform form and field actions. Let us learn how to add a simple validate script that allows only the admin user to add records to the Employee form.
The expression builder comprises of various tabs to enable you to build the required expression for each deluge statement. Each tab is explained below:
This tab displays all the fields in the selected form. Selecting a field will add the syntax input.<fieldName> to the text area below and refers to the value of the field input in the form.
This tab displays the custom variables, if any, defined by the user in the deluge script. For more information, refer Set Variable.
This tab displays the date and string variables supported by Deluge. Refer Deluge System Variables, for more information.
This tab displays the user-defined collection variables that holds one or more records fetched from a form. For more information, refer collection variables
This tab displays the user-defined functions that can be called from anywhere within the Deluge script. For more information on defining functions, refer Functions.
This tab displays the date, time, numeric and string functions supported by Deluge. Refer Built-in Functions for more information.
This tab will be displayed only while configuring the on edit -> validate script. It displays all the fields in the selected form. Selecting a field will add the syntax old.<fieldName> to the text area below and refers to the previous value held by the field, before editing. You can refer the old field values to perform calculations or store the record history.
Click on Save Script option to add the on add -> validate script to the script definition.
If you are well-versed with Deluge Scripting or if you have the script code ready, you can switch on to Free-flow scripting mode to create your script without the use of the drag-and-drop editor.
To go to free-flow scripting mode,
Select the Free-flow Scripting link displayed in the top-right corner of the script builder. Note that the drag-and-drop tasks will not be displayed in this mode. You can directly add the required script to the editor area and save the script. Make sure that the correct form and form action is selected before adding the script.