Alert Config

The Predefined Configuration for the Alert function

Alert State

The Alert Config primarily contains a collection of Alert Definitions:

PropertyDescriptionDefault
AlertDefinitionsAlert Definition collection - will trigger Alerts when condition is metnull
MaxAlertsInStoreHow many alerts held in State at any one time; when limit is breached, oldest alert will be removed.20

Alert Definition Object

The Alert Definition object is as follows:

note

The Predicate is mandatory and triggers the Alert when its rule is met.

PropertyDescription
AlertPropertiesSeries of properties which set what happens when Alert is triggered
MessageTypeType of Alert: 'Info', 'Success', 'Warning', 'Error'; influences Alert colour, icon and logging
PredicateTrigger for Alert; Predicate will include a type (e.g. 'GreaterThan') and potentially inputs (e.g. '20')
ScopeWhere Alert can be triggered: one, some or all columns or DataTypes
tip

Alert also implements QueryObject which means that an optional Expression can be set in addition to the predicate for more advanced scenarios.

PropertyDescription
ExpressionThe Expression itself - will be evaluated using the Adaptable parser
SharedQueryIdReference to the Uuid property of existing Shared Query in Query State

Alert Properties

The AlertProperties object in the Alert Definition sets the behaviour for when the Alert is triggered:

PropertyDescription
HighlightCellIf cell edit triggered tthe Alert it will colour that cell using the MessageType property of the triggering Alert Definition
JumpToCellGrid will 'jump' to the cell which triggered the Alert
LogToConsoleLogs the Alert message to the console
ShowInDivShows Alert text in the div specificed in AlertDisplayDiv property of Alert State.
ShowInGlue42Displays the alert as Glue42 notification; only available with Glue42 plugin and in Glue42 environment
ShowInOpenFinDisplays the alert as OpenFin notification; only available with OpenFin plugin and in OpenFin environment
ShowPopupDisplays a popup in the middle of the screen

Example

export default {
Alert: {
MaxAlertsInStore: 10,
AlertDefinitions: [
{
Scope: {
ColumnIds: ['InvoicedCost'],
}
MessageType: 'Warning',
Predicate: {
PredicateId: 'GreaterThan',
Inputs: [2000],
},
AlertProperties: {
ShowPopup: true,
},
},
{
Scope: {
ColumnIds: ['ItemCount'],
}
MessageType: 'Info',
Predicate: {
PredicateId: 'PercentChange',
Inputs: [100],
},
AlertProperties: {
ShowPopup: false,
},
},
],
},
} as PredefinedConfig;

In this example we have created 2 Alert Definitions:

  • On InvoicedCost column which will warn (and show a popup) when the value is > 2000

  • On ItemCount column which will show info alert (but not show a popup) if the new value is more than double (i.e. has percent change > 100).

More Information