How can I update records in a form using Deluge Script?

How can I update records in a form using Deluge Script?

About the application 

You can fetch and update records from a form using Deluge script.  Let us illustrate this with the help of an example. The application Library Manager has two forms:

Books - To enter the details about each book with fields Name, Status and Author. The following books are owned by the library. The column 'Status' with values 'Available' and 'Issued', indicates whether the book is available in the library or is issued to any user.


Issue Book - To enter the details about the books issued. This form has a lookup field "Book Name" which imports the Books from the above form.  Only the Books whose status is "Available" is listed in the lookup field. This is achieved by specifying the criteria Status=="Achieved", while creating the lookup field. When a Book is issued, the status of the Book is updated from "Available" to "Issued"  in the Books form.  For example, the following books are issued.


In the Books form, the Status of these books will be set to "Issued". This is achieved using the "Issue _Book -> on add -> on success" script, given below:



Code Explanation

MyBook = Books [Name == input.Book_Name]; - Fetch records from Books form with the given criteria and store it in collection variable named "MyBook"

MyBook.Status = "Issued"; - Access the Mybook variable and update the Status field with value "Issued".

The books issued is now updated with Status as "Issued" in the Books form, as shown in the screen-shot below:


To install the application,

  1. Download the script file (.ds file)
  2. Install the application to your account. Click here to learn how to install using the script file (.ds file)
    • Related Articles

    • How can I send mail to particular records using Deluge script?

      You can send mail to specific records in a form by using the sendmail Deluge syntax within a for each deluge statement. Refer the link Fetch a collection of records and iterate over them, for more information.
    • How can I get the values entered for certain fields via Deluge script?

      Many a times, when you are developing an application, you may need to get the value(s) entered for the fields in the form. To get the particular value, you can do so in Deluge Script, using the statement: input.<Field Name>For ex, if you would like ...
    • How can I check for duplication of records using Script?

      The following sample code added to the Form actions -> on add -> on validate block and Form actions. -> on edit -> on validate block of the Script tab, will check if the same team member is added more than once to the Team Member form.  If true, the ...
    • How to Iterate Records in a Form

      The "Task Management" application illustrates the usage of for each record Deluge statement, to iterate records in a form. The applicationcomprises of the following forms: Staff Details: To store the staff details like name, emailid etc. Task: To ...
    • How to Iterate Records in a Form

      About the application  The "Task Management" application illustrates the usage of for each record Deluge statement, to iterate records in a form. The applicationcomprises of the following forms: Staff Details: To store the staff details like name, ...