The add record Deluge task is used to insert a new record to a given Form with values specified in the expression.
<ID> = insert into <formname>
<fieldname1> = <expression>
<fieldname2> = <expression>
<fieldname3> = <expression>
<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.
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.
insert into expense
Added_User = zoho.loginuser
Amount = input.amount
Category = input.category
Expense_Date = zoho.currentdate
Payment_method = input.pay_method
Description = "Monthly Payments"
In the above code,
- Field name on the left like Added_User, Amount refers to the deluge field names in the expense from
- Field names on the right with syntac input.<field name> refers to the deluge field names in the payment form.