Add Record

Table of Contents

Description

The add record Deluge task is used in Form action and Field action scripts to insert a new record to a given Form with values specified in the expression.

Syntax

The Form definition of the script will be displayed in the Form Definition -> With Action block of the Script Builder, in the format given below. Here, the script is added to the Form Actions - On Add - On Success block of the form.

<formname> - name of the form to insert a new record.
<fieldname> - the name of the field in the form
<ID> - ID value of the inserted record
<expression> - the field value or a deluge expression that returns a value

Steps to add the script

To add the add record task in Script Builder,

Invoke the Script Builder and select the Form/Field action.

Drag-n-drop the add record task from the left-side task tree.

Click on Edit to specify the form name, field names and value in the Edit dialog. All the forms in the current application will be listed in the Select Form list-box.

To specify field values, the Deluge expression builder can be invoked for each field by selecting the "Write Expression" button.

Example

The sample code given below adds a new record to the expense form based on the values submitted in the payments form. The script is added to the on add -> on success block of the payment form and will be executed when a new record is added to the payment form.