Displaying Alerts

View as Markdown

Summary

  • Alerts fire when an Alert Definition matches grid activity — usually a cell edit or tick, but also row add/remove, schedules, or live observable rules
  • AdapTable provides seven alert categories; most use an AdapTableQL Rule (Boolean, Observable, or Aggregation). Scheduled alerts use a Schedule instead
  • Each alert has a MessageType, message text, optional Alert Properties (behaviours), and optional toast Notifications (message, command buttons, or a full form)
  • Definitions are stored in Adaptable State; they can be scoped to Layouts and suspended at run time

Alerts are one of the most popular features in AdapTable, and which add most value to run-time users.

You create an Alert Defintion which includes:

  • the type of Alert
  • the condition / rule that triggers it
  • how it should look (message type and copy)
  • what should happen when it fires (highlight, jump, notification, validation rollback, and more)

Note

An Alert can be limited to specific layouts via Layout Extensions

Topics in this Section

TopicDescription
Data Change AlertsBoolean rules on cell changes with Column Scope
Relative Change AlertsANY_CHANGE, PERCENT_CHANGE, and ABSOLUTE_CHANGE on the edited cell
Row Change AlertsRows added or removed; optional per-row boolean Rule
Aggregation AlertsBoolean rules evaluated across many rows (limits-style analysis)
Observable AlertsLive history, time windows, and no-change detection
Scheduled AlertsOne-off or recurring schedule (no Rule)
Validation AlertsBlock invalid edits and roll back before commit
Alert MessageHeaders, body text, tokens, templates, and message options
Alert NotificationToast notifications, command buttons, and developer-defined Alert Forms
Alert BehavioursHighlight, jump, log, custom container, and related properties
Configuring AlertsAlert Options, highlight durations, detection policy, batch consolidation
Listening to AlertsAlert Fired event and payload
Alerts Technical ReferenceAlert Definitions, Options, State, and API

Alert definitions

Alert Definitions are configured in Alert Initial State or created at run time.

Each AlertDefinition object includes a number of properties including:

  • Name
  • MessageType, MessageHeader / MessageText (see Alert Message)
  • AlertProperties — behaviours such as highlight, jump, and display notification (see Alert Behaviours)

Alert Type

There are 7 different types of Alerts in AdapTable

Note

  • This property is technically optional and will be inferred by AdapTable from object if not provided
  • However we recommend always setting it to avoid any confusion
Alert typeSummary
Data Change AlertsCell change makes a boolean Rule true; uses Column Scope and standard boolean expressions
Relative Change AlertsANY_CHANGE, PERCENT_CHANGE, and ABSOLUTE_CHANGE on the changing cell
Row Change AlertsRow added or removed (RowChangeTrigger); use AdapTable-aware row APIs (see that page)
Aggregation AlertsAggregation Expressions across multiple rows (e.g. limits on summed PnL)
Observable AlertsObservable Expressions — ticks, history, or no-change in a time window
Scheduled AlertsFires on a Schedule (one-off or recurring); no Rule
Validation AlertsRolls back edits that break the Rule before the cell commit completes

Having 7 different Alert types can sometimes be overwhelming.

So consult this table to work out which Alert Type is appropriate for your use case:

If you need to fire an Alert when…Use
A cell value changes and a rule becomes trueData Change Alerts
A cell changed by a particular amount (% or absolute)Relative Change Alerts
A row is added or removedRow Change Alerts
A summary across rows crosses a limitAggregation Alerts
A a live / history rule becomes true (ticks, no-change windows)Observable Alerts
A calendar schedule is triggeredScheduled Alerts
An edit breaks a rule and needs to be rejectedValidation Alerts

Alert Rule

The most common Alert Types all have a rule which is responsible for triggering the Alert.

These include Data Change, Relative Change, Validation, Aggregation, and Observable Alerts.

Hint

These Alert types also contain Scope which limits the rows or columns in the Grid the Rule applies to

The rule is evaluated with AdapTableQL when data changes (or continuously for Observable).

Note

  • Row Change Alerts have an optional Rule that sets whether the added / removed row should trigger an Alert
  • Scheduled Alerts have no Rule - the message comes from the Alert Definition

Message Type

Each alert has a MessageType (Info, Success, Warning, Error).

This is used in the Alert toolbar, tool panel, status bar, and toast notifications.

Message TypeDefault CSS variableDefault Colour
Info--ab-color-info(#17a2b8)
Success--ab-color-success(#419641)
Warning--ab-color-warn(#eb9316)
Error--ab-color-destructive(#dc3545)

Find Out More

When an Alert Fires

Every fired Alert is recorded in numerous places in the AdapTable UI including:

In addtional, AdapTable raises the Alert Fired event.

There are many optional Alert Behaviours (Alert Properties) that can occur when an Alert is triggered:

  • highlight cell
  • jump to cell
  • jump to row
  • log to console
  • display in a custom container
  • perform rollback (post-validation)
  • display an Alert Toast Notification (plain message, command buttons, or a developer-defined form)

Caution

Alert options

There are many properties available in alertOptions in Adaptable Options to configure Alerts including:

PurposeOption
Highlight timing (ms)cellHighlightDuration / rowHighlightDuration / statusbarHighlightDuration
Evaluate rules on rawValue vs formattedValuedataChangeDetectionPolicy
Cap stored fired alertsmaxAlertsInStore
One toast when a batch edit triggers many cellsconsolidateBatchAlerts
Dynamic message functionsalertMessageHeader / alertMessageText
Full notification forms and custom button handlersalertForms / commandHandlers

Find Out More

Server Side Row Model

Alert behaviour varies when using the Server-Side Row Model based on the Alert Type.

Data Change, Relative Change, and Validation Alerts all evaluate normally on the client as cells change.

However Aggregation and grid-wide Observable rules may need rows that are not loaded and wont trigger an Alert.

Hint

You can evaluate Alerts on the server and return results to AdapTable when client-side evaluation is not sufficient

Managing Alerts at run time

The Alert section of the Settings Panel lists definitions with create, edit, delete, and suspend.

When an alert is suspended, it does not fire (but the object remains in State).

Observable subscriptions are removed until the Alert is unsuspended.

Hint

Set DisplayNotification to false to display triggered Alerts in the toolbar but without showing the Toast Notification

UI Entitlements

  • Full — normal create/edit/suspend UI.
  • Hidden / ReadOnly — Settings Panel and module UI hidden or read-only; fired alerts still run for ReadOnly unless suspended.

FAQ

Can we show alerts in the system tray? Not directly — AdapTable is not able to access the OS tray. Subscribe to the Alert Fired event and show UI wherever you need.

Can we turn off pop-up notifications? Yes — set DisplayNotification to false on the definition, or suspend the alert in the Settings Panel. The suspend command button is also available on notifications (see Alert Notification).

Can toast settings differ per Alert? No — per-alert properties control whether a notification shows. Duration and styling come from Notification Options for all toasts.