Displaying notifications (notification.*)
You can use notification to display a message to the user directly from a client script.
Why lowercase?
Unlike Field and Dataset (PascalCase), which are concepts specific to client scripts, notification is written in lowercase on purpose: it is a generic function available under the exact same name in server scripts too. The lowercase casing signals "shared across script types," not "unique to the client environment." There is no Notification (PascalCase) alternative, and none is planned — using it will throw a ReferenceError.
Available functions
| Function | Description |
|---|---|
notification.info |
Displays a general information message. |
notification.success |
Indicates that an operation completed successfully. |
notification.warning |
Warns the user about a non-blocking issue. |
notification.error |
Signals that an operation failed. Unlike the others, this stays until dismissed. |
Syntax
notification.info(title, message);
notification.success(title, message);
notification.warning(title, message);
notification.error(title, message);
Parameters
All four functions take the same parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | String | Yes | The title of the notification. |
| message | String | Yes | The main content or body of the notification. |
Return value
None.
Behavior
All four functions display the notification immediately (unlike the server-side equivalent, which collects notifications and delivers them at the end of the script run). info, success, and warning notifications disappear automatically; error notifications stay visible until the user dismisses them.
Example
const vendorName = Field.get('vendorsDataset', 'name', '0');
if (vendorName) {
notification.success('Vendor found', `Current vendor name is: ${vendorName}`);
} else {
notification.warning('Vendor not found', 'Please define the vendor first!');
}