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 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
alert <expression>;
alert([<field_link_name>], <message>);
Parameter | Data type | Description |
<field_link_name> (optional) | FIELD | The link name of the field below which you need to display the error message. Note:
|
<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
Workflow event | When <field_link_name> is not provided | When <field_link_name> is provided |
On Load | Yes | No |
On Validate | Yes | Yes |
On Success | No | No |
On User input | Yes | No |
Subform on add row | Yes | No |
Subform on delete row | Yes | No |
Workflow event | when <field_link_name> is not provided | when <field_link_name> is provided |
On Load | Yes | No |
On Validate | Yes | Yes |
On Success | No | No |
On User input | Yes | No |
Subform on add row | Yes | No |
Subform on delete row | Yes | No |
Workflow event | when <field_link_name> is not provided | when <field_link_name> is provided |
On Load | Yes | No |
On Validate | Yes | Yes |
On Success | No | No |
On User input | Yes | No |
On Update | Yes | No |
Subform on add row | Yes | No |
Subform on delete row | Yes | No |
Workflow event | when <field_link_name> is provided | when <field_link_name> is not provided |
On Validate | No | Yes |
On Success | No | No |
Workflow event | when <field_link_name> is provided | when <field_link_name> is not provided |
On a scheduled date | No | No |
During approval process | No | No |
During payment process | No | No |
In a Custom Function | No | No |
In an Action item in report | No | No |
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"
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
"Enter a future date"