Client Functions

Client Functions

This guide will help you with the following:
1. Hide | Show
2. Enable | Disable
3. Add | Append
4. Select | Deselect
5. SelectAll | DeselectAll
6. Clear items
7. Alert 
8. Reload


1. Hide | Show

Overview

The hide deluge task hides a specified field on a form.
The show deluge task reverses the hide action and unhides the hidden field in the form.
Note:
To hide or show a field in a report, navigate to column properties in a Report, select the required field and click on the delete icon.
To hide fields for a set of users, you can define field permissions.

Syntax

To hide a field
  1. hide <field_link_name>;
To unhide a field
  1. show <field_link_name>;

This task can be used in the following events

Example

The following snippet hides the "Phone Number" field if the selected contact mode is "Email". 
  1. if(Contact_Mode=="Email")
  2. {
  3. hide Phone_Number;
  4. }
  5. else
  6. {
  7. show Phone_Number;
  8. }

2. Enable | Disable

Overview

The Disable deluge task disables a specified field on the form. The disabled field will be grayed out, and the user will not be able to add data to that field.
The Enable deluge task reverses the Disable action and re-enables a disabled field for users to fill it out in the form.
Note:
To disable fields for a set of users, you can define field permissions.

Syntax

To disable a field
  1. disable <field_link_name>;
To enable a field
  1. enable <field_link_name>;

This task can be used in the following events

Example

The following snippet disables the "Total Amount" field.
  1. disable Total_Amount;

3. Add | Append

Overview

The Add deluge task replaces all the existing choices in a single-select, multi-select field or a lookup field type with specified choices.
The Append deluge task appends specified choices to the existing choices in a single-select, multi-select or a lookup field type.
Note:
  1. Only the first add command in each script action will remove the previous choices
  2. The same choice cannot be added or appended twice
  3. It is advisable to use the clear task before using the add task, to make sure the choices are cleared before the new choices are added.

Syntax

To add items
  1. <field_link_name>:ui.add(<expression>);
To append items
  1. <field_link_name>:ui.append(<expression>);

This task can be used in the following events

Examples

1) In the following example, "colors" is a form field of drop-down type. "Get_Bright_Colors" is a decision-box field type, which when checked, adds one set of colors to the "colors" field and adds another set if unchecked.
  1. if(Get_Bright_Colors)
  2. {
  3. addColors={"white","orange","yellow"}
  4. }
  5. else
  6. {
  7. addColors={"Brown","Black","Grey"};
  8. }
  9. clear colors;
  10. colors:ui.add(addColors);
2) If "product" is drop-down field with options "Zoho CRM", "Zoho Creator" and "Zoho Desk", the following script appends "Zoho Cliq" to the options. The "product" field will then have "Zoho CRM", "Zoho Creator", "Zoho Desk" and "Zoho Cliq" as the choices.
  1. product:ui.append("Zoho Cliq");    

4. Select | Deselect

Overview

The Select deluge task selects a specified choice in a single-select, multi-select or a lookup field.
The Deselect deluge task deselects a specified choice(previously selected) in a single-select, multi-select or a lookup field.
Note:
If a choice is selected using the assignment operator '=', and another choice is selected using the select task, the assignment operator will overwrite the select task.

Syntax

To select a choice
  1. <field_link_name>.select(<expression>);
To deselect a selected choice
  1. <field_link_name>.deselect(<expression>);

This task can be used in the following events

Example

In the following example, if no color has been selected from the options in "Color selection" field, the option "White" gets selected automatically.
  1. if(Color_selection ==null)
  2. {
  3. Color_selection.select("White");
  4. }

5. SelectAll | DeselectAll

Overview

The selectAll deluge task preselects all choices in a specified multi-select or a lookup field(multi select or checkbox display).
The deselectAll deluge task deselects all choices(previously selected) in a specified multi-select or a lookup field(multi select or checkbox display).

Syntax

To select all choices
  1. <field_link_name>.selectAll;
To deselect all selected choices
  1. <field_link_name>.deselectAll;

This task can be used in the following events

Examples

1) In the following example, if the "Register all" decision box is checked, all the choices(games) present in the "Games" multi-select field will be selected.
  1. if(Register_all)
  2. {
  3. Games.selectall();
  4. }
2) In the following example, if the "Reset selection" decision box is checked, all the choices(games) present in the "Games" multi-select field will be deselected.
  1. if(Reset_selection)
  2. {
  3. Games.deselectall();
  4. }

6. Clear items

Overview

The clear items deluge task clears(removes) all choices in a specified single-select, multi-select or lookup field.
This task only hides the choices from appearing, and does not delete them from the database.
Note:
It is advisable to use the clear task before using the add task, to make sure the choices are cleared before the new choices are added.

Syntax

  1. clear <field_link_name>;

This task can be used in the following events

Example

In the following example, "colors" is a form field of drop-down type. "Get_Bright_Colors" is a decision-box field type, which when checked, adds one set of colors to the "colors" field and adds another set if unchecked. Before adding the choices, the clear task makes sure the previous choices have been removed.
  1. if(Get_Bright_Colors)
  2. {
  3. addColors={"white","orange","yellow"}
  4. }
  5. else
  6. {
  7. addColors={"Brown","Black","Grey"};
  8. }
  9. clear colors;
  10. colors:ui.add(addColors);

7. Alert

Overview

The Alert Deluge task displays a specified message in a pop-up window or below the specified field to the user.
This task will be listed under Client Functions in all events except the "On Validate" event in which it will be listed under Debug.
Note:
  1. The collective response from the info and alert statements in a function can be up to 500 KB. When this is limit is exceeded, the response will be truncated and appended with the following note:
  2. The info message has been truncated because its size exceeded 500 KB.
  3. The alert task will be executed in the On Validate event only when followed by the cancel submit task or the cancel delete task.
  4. The info task differs from the alert statement in the following ways:
  5. The info statement can be used in all workflow events.
  6. A user must be an admin to be able to view the output of the info statement.
  7. When the info statement is executed in On load, On validate, On success, On user input, Subform on add row, and Subform on delete row events, the output of the info statement can be viewed only by clicking on "View Log Details" button at the bottom of the form.

Syntax

  1. alert <expression>;
  (or)
  1.  alert([<field_link_name>], <message>);

This task can be used in the following events

Example 1: Standard alert

In the following example, if the Age field has a value lesser than 18, the user is shown an alert message and the form submission is canceled. This alert message will be displayed in a pop-up window.
  1.  if(Age < 18)
  2.  {
  3.  alert"You are not authorized to make this transaction";
  4.  cancel submit;
  5.  }
where:
"You are not authorized to make this transaction"The TEXT that represents the custom error message that needs to be displayed in a pop-up window.

Example 2: Inline alert

The following example displays a custom error message below the specified date field - due_date.
  1.  if(due_date < zoho.currentdate)
  2.  {
  3.  alert(due_date, "Enter a future date");
  4.  cancel submit;
  5.  }
where:
due_dateThe FIELD that represents the field link name.
"Enter a future date"The TEXT that represents the custom error message.

8. Reload

Overview

The Reload deluge task reloads the form.
Note: When a form is reloaded, its unsubmitted field entries (if any) will be lost.

Syntax

  1. reload;
This task can be used in the following events


    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION








                                    You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                        Manage your brands on social media

                                          Zoho Desk Resources

                                          • Desk Community Learning Series


                                          • Digest


                                          • Functions


                                          • Meetups


                                          • Kbase


                                          • Resources


                                          • Glossary


                                          • Desk Marketplace


                                          • MVP Corner


                                          • Word of the Day


                                            Zoho Marketing Automation

                                              Zoho Sheet Resources

                                               

                                                  Zoho Forms Resources


                                                    Secure your business
                                                    communication with Zoho Mail


                                                    Mail on the move with
                                                    Zoho Mail mobile application

                                                      Stay on top of your schedule
                                                      at all times


                                                      Carry your calendar with you
                                                      Anytime, anywhere




                                                            Zoho Sign Resources

                                                              Sign, Paperless!

                                                              Sign and send business documents on the go!

                                                              Get Started Now




                                                                      Zoho TeamInbox Resources



                                                                              Zoho DataPrep Resources



                                                                                Zoho DataPrep Demo

                                                                                Get a personalized demo or POC

                                                                                REGISTER NOW


                                                                                  Design. Discuss. Deliver.

                                                                                  Create visually engaging stories with Zoho Show.

                                                                                  Get Started Now









                                                                                                      • Related Articles

                                                                                                      • Functions

                                                                                                        This guide helps you with the following: Create Functions  Normal Functions REST API Functions Invoke Functions  Edit Functions  Delete Functions Rest API Functions Authentication Version 2.0 Version 1.0 Example Comparison of Version 2.0 and 1.0 ...
                                                                                                      • Custom Functions

                                                                                                        The guide will help you with the following: Create Custom Functions Program Custom Functions  Test Custom Functions  Associate with Workflow Rules  Manage Custom Functions  Custom functions help in automation where procedural logic is required, which ...
                                                                                                      • Logical Functions

                                                                                                        The guide helps you with the following: 1. Difference between isBlank(), isNull() and isEmpty() functions 2. Equals 3. isBlank 4. isEmpty 5. isNull 6. isValidObject Difference between isBlank(), isNull() and isEmpty() functions The table below lists ...
                                                                                                      • Custom Functions

                                                                                                        Custom functions are user built functions that help them to add new features to Zoho CRM as per their requirement. These are written in deluge script and are easy to construct. The syntax and logic are simple to formulate and aid in the continuous ...
                                                                                                      • Built-in Functions

                                                                                                        This guide will help you with the following: String functions  Numeric Functions  Boolean string functions  Date Functions  Time functions  List Functions  Map Functions  XML Functions  URL Functions  Form Data Functions   A function is a set of ...
                                                                                                        Wherever you are is as good as
                                                                                                        your workplace

                                                                                                          Resources

                                                                                                          Videos

                                                                                                          Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                          eBooks

                                                                                                          Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                          Webinars

                                                                                                          Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                          CRM Tips

                                                                                                          Make the most of Zoho CRM with these useful tips.



                                                                                                            Zoho Show Resources