Application > Create New Application > By writing Deluge Script

By writing Deluge Script

Tags:  

Overview

If you are well versed in Deluge scripting, you can create an entire application by writing deluge script (or) you can import an existing  Deluge Script file (.ds file) to create your application. 


Write code from scratch

You can create a custom application from scratch by writing Deluge script.  The steps to create a sample Contacts application is given below:

  • Login to Zoho Creator and click on the Create New Application button.

  • Select the Deluge Script icon on the left-side as shown below.

  • Select the Write Script option as shown below.

  • If you are well versed with Deluge Script Syntax, write the script file with the required syntax (or) copy and paste an existing script file, as shown below:


  • Click the Create Now button to save the script. You will be directed to the newly created application.

Sample Deluge Script to create the "Contacts Application"

Copy/paste the below given snippet and save it to create an application called "Contacts". The application will have one form named Contacts form and a list view named Contacts Form View displayed under the Home tab. 

application "Contacts"
{
    allow html = true
    date format = "dd-MMM-yyyy"
    time zone = "IST"
    section Home
    {
        form  Contacts_Form
        {
            displayname  =  "Contacts Form"
            
            Name
            (
                type  =  text
                width  =  25
                tooltip  =  "Web application"
            )

            Email_ID
            (
                displayname  =  "Email ID"
                type  =  email
                width  =  25
                tooltip  =  "Web application"
            )

            Contact
            (
                type  =  decimal
                width  =  20
                maxchar  =  99
                tooltip  =  "Web application"
            )

            DOB
            (
                type  =  date
                tooltip  =  "Web application"
            )

            Country
            (
                type  =  text
                width  =  25
                tooltip  =  "Web application"
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Contacts_Form_View
        {
            displayname = "Contacts Form View"
            show  all  rows  from  Contacts_Form
            (
                Name
                Email_ID as "Email ID"
                Country
                DOB
                Contact, display total
            )
            filters
            (
                DOB
            )
            options
            (
                display rows = 10
            )
        }

    }

}


Import a deluge script (.ds) directly 

 An entire application can be saved as a Deluge Script (see contacts.ds). The deluge script file can then be imported in Zoho Creator to create a new application. To know more about saving an application as .ds file, refer to Save / Backup an Application.

  • Login to Zoho Creator and click on the Create New Application button.

  • Select the Deluge Script icon on the left-side as shown below.

  • Select the Import Deluge Script option.

  • Just select the .ds file from your local file system using the browse button.

  • And click the Create button to save the script. You will be directed to the newly created application.



0 Comments  Show recent to old
Post a comment



 RSS of this page