Choose where you’d like to start

Alert

Note: This task is applicable only to Zoho Creator.

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:

  • 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:

    The info message has been truncated because its size exceeded 500 KB.
  • The alert task will be executed for the record events Created, Edited, Created or Edited in the On Validate form event only when followed by the cancel submit task.
  • The info task differs from the alert statement in the following ways:
    • The info statement can be used in all workflow events.
    • A user must be an admin to be able to view the output of the info statement.
    • When the info statement is executed in On loadOn validateOn successOn user inputSubform 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

 alert <expression>;
  (or)
 alert([<field_link_name>], <message>);
ParameterData typeDescription
<field_link_name>
(optional)
FIELD

The link name of the field below which you need to display the error message.

Note:
  • When this parameter is provided:
    • The error message will be displayed below the specified field
    • This task can be used only in the "On Validate event when a record is created, edited, or created or edited. So, the error message will be displayed below the specified field only on submitting the form. Providing any alternate value to the error field will clear the error message below the specified field but evaluating the new value will be done only on resubmitting the form.
    • The maximum number of alert tasks that can be executed by a single "On Validate" action is 10.
    • If multiple alert tasks are specified, the order of execution starts from the top.
  • When this parameter is not provided:
    • The error message will be displayed in a pop-up window.
    • This task can be used in selected workflow events. Click here for the entire list.
    • If multiple alert tasks are specified, the order of execution starts from the bottom.
<message>All data types

The message to be displayed. You can directly specify a value, or you can also specify an expression, i.e. a combination of values, constants, variables, operators, functions and so on, which evaluates to a value.

Note: If the <field_link_name> parameter is provided, the error message can only be a TEXT and can hold only up to 256 characters.

This task can be used in the following events

When a record is Created
Workflow eventWhen <field_link_name> is not providedWhen <field_link_name> is provided
On LoadYesNo
On ValidateYesYes
On SuccessNoNo
On User inputYesNo
Subform on add rowYesNo
Subform on delete rowYesNo
When a record is Created or Edited
Workflow eventwhen <field_link_name> is not providedwhen <field_link_name> is provided
On LoadYesNo
On ValidateYesYes
On SuccessNoNo
On User inputYesNo
Subform on add rowYesNo
Subform on delete rowYesNo
When a record is Edited
Workflow eventwhen <field_link_name> is not providedwhen <field_link_name> is provided
On LoadYesNo
On ValidateYesYes
On SuccessNoNo
On User inputYesNo
On UpdateYesNo
Subform on add rowYesNo
Subform on delete rowYesNo
When a record is Deleted
Workflow eventwhen <field_link_name> is providedwhen <field_link_name> is not provided
On ValidateNoYes
On SuccessNoNo
Other workflow events
Workflow eventwhen <field_link_name> is providedwhen <field_link_name> is not provided
On a scheduled dateNoNo
During approval processNoNo
During payment processNoNo
In a Custom FunctionNoNo
In an Action item in reportNoNo

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.

 if(Age < 18)
 {
 alert "You are not authorized to make this transaction";
 cancel submit;
 }

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.

 if(due_date < zoho.currentdate)
 {
 alert(due_date, "Enter a future date");
 cancel submit;
 }

where:

due_date
The FIELD that represents the field link name.
"Enter a future date"
The TEXT that represents the custom error message.

Get Started Now

Execute