# Alerts Technical Reference

Canonical page: https://www.adaptabletools.com/docs/technical-reference-alerting

## Alert State

| Property | Type | Description |
| --- | --- | --- |
| [AlertDefinitions](https://www.adaptabletools.com/docs/reference/alertstate.md#alertdefinitions) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md)`[]` | Alerts to evaluate. Each one is a rule-based alert (`Scope` + `Rule`), a row-change alert (`RowChangeTrigger`), or a scheduled alert (`Schedule`). |

### Rule Based Alert Definition

| Property | Type | Description |
| --- | --- | --- |
| [AlertForm](https://www.adaptabletools.com/docs/reference/rulebasedalertdefinition.md#alertform) | `string \| `[`AlertButtonForm`](https://www.adaptabletools.com/docs/reference/alertbuttonform.md) | Form to display in Alert with buttons and inputs |
| [AlertProperties](https://www.adaptabletools.com/docs/reference/rulebasedalertdefinition.md#alertproperties) | [`RuleAlertProperties`](https://www.adaptabletools.com/docs/reference/rulealertproperties.md) | Properties which set what happens when the Alert is triggered (notification and grid behaviours) |
| [Rule](https://www.adaptabletools.com/docs/reference/rulebasedalertdefinition.md#rule) | `string` | AdapTableQL boolean expression deciding when the Alert is triggered.<br/><br/>The kind is inferred from the text: a per-row rule such as<br/>`[price] > 100`, an aggregated rule such as `SUM{[notional]} > 1000000`,<br/>or a live (observable) rule such as `CHANGE_COUNT{[price], WITHIN(5m)} >= 3`. |
| [Scope](https://www.adaptabletools.com/docs/reference/rulebasedalertdefinition.md#scope) | [`ColumnScope`](https://www.adaptabletools.com/docs/reference/columnscope.md) | Where Alert can be triggered: one, some or all columns or DataTypes |
| [TriggerPolicy](https://www.adaptabletools.com/docs/reference/rulebasedalertdefinition.md#triggerpolicy) | [`AlertTriggerPolicy`](https://www.adaptabletools.com/docs/reference/alerttriggerpolicy.md) | When a live rule (one reading change history — CHANGE_COUNT[price],<br/>WITHIN(5m) = 3 — or the clock) fires. Live rules are re-evaluated on<br/>data changes and on window expiry alike, and fire only on the transition<br/>from false to true (per row, or once for a grid-level rule). Ignored for<br/>every other rule. |
| [IsReadOnly](https://www.adaptabletools.com/docs/reference/rulebasedalertdefinition.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |
| [IsSuspended](https://www.adaptabletools.com/docs/reference/rulebasedalertdefinition.md#issuspended) | `boolean` | Suspends (i.e. turns off) an Adaptable Object |

#### Alert Properties

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [HighlightCell](https://www.adaptabletools.com/docs/reference/rulealertproperties.md#highlightcell) | `boolean \| `[`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Colours the cell that triggered the alert. `true` uses the colour for `MessageType`. An  is applied instead of that colour. |   |
| [HighlightRow](https://www.adaptabletools.com/docs/reference/rulealertproperties.md#highlightrow) | `boolean \| `[`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Colours the row that triggered the alert. `true` uses the colour for `MessageType`. An  is applied instead of that colour. |   |
| [JumpToCell](https://www.adaptabletools.com/docs/reference/rulealertproperties.md#jumptocell) | `boolean` | Grid will &#39;jump&#39; to the changed cell which triggered the Alert |   |
| [JumpToRow](https://www.adaptabletools.com/docs/reference/rulealertproperties.md#jumptorow) | `boolean` | Grid will &#39;jump&#39; to the newly added row which triggered the Alert |   |
| [PreventEdit](https://www.adaptabletools.com/docs/reference/rulealertproperties.md#preventedit) | `boolean` | Automatically prevent any cell edit which triggered the Alert (i.e. validation) | false |

`TriggerPolicy` is an [`AlertTriggerPolicy`](https://www.adaptabletools.com/docs/reference/alerttriggerpolicy.md):

| Property | Type | Description |
| --- | --- | --- |
| [FireOn](https://www.adaptabletools.com/docs/reference/alerttriggerpolicy.md#fireon) | `'BecomeTrue'` | `'BecomeTrue'` (the only policy, and the default): fire when the rule<br/>turns from false to true; stay silent while it remains true; a rule that<br/>is already true when the Alert is created does not fire until it turns<br/>false and true again. |

`Scope` is a [Column Scope](https://www.adaptabletools.com/docs/technical-reference-column-scope/index.md):

<ApiTypeCard name="ColumnScope" href="/docs/reference/columnscope" choice>

Which columns an object applies to. Set exactly one shape.

<ApiMember name="{ All: true }" href="/docs/reference/columnscope">

<ApiMemberType>

`true`

</ApiMemberType>

Matches every column. `All` must be `true`.

</ApiMember>

<ApiMember name="{ DataTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

`('text' | 'number' | 'boolean' | 'date' | 'textArray' | 'numberArray')[]`

</ApiMemberType>

Data types to match, for example `['number']` or `['text', 'textArray']`. Object, tuple and unknown columns are not scope data types. Name those columns with `ColumnIds`.

</ApiMember>

<ApiMember name="{ ColumnIds }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

Column ids to match. These are AG Grid `colId` values.

</ApiMember>

<ApiMember name="{ ColumnTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

AG Grid column type names, the strings set on `colDef.type`.

</ApiMember>

</ApiTypeCard>

### Schedule Based Alert Definition

| Property | Type | Description |
| --- | --- | --- |
| [AlertProperties](https://www.adaptabletools.com/docs/reference/scheduledalertdefinition.md#alertproperties) | [`ScheduledAlertProperties`](https://www.adaptabletools.com/docs/reference/scheduledalertproperties.md) | Notification properties for scheduled alerts (no grid behaviours) |
| [Schedule](https://www.adaptabletools.com/docs/reference/scheduledalertdefinition.md#schedule) | [`Schedule`](https://www.adaptabletools.com/docs/reference/schedule.md) | When the alert should run |
| [IsReadOnly](https://www.adaptabletools.com/docs/reference/scheduledalertdefinition.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |
| [IsSuspended](https://www.adaptabletools.com/docs/reference/scheduledalertdefinition.md#issuspended) | `boolean` | Suspends (i.e. turns off) an Adaptable Object |

#### Alert Properties

| Property | Type | Description |
| --- | --- | --- |
| [IncludeSuspendButton](https://www.adaptabletools.com/docs/reference/scheduledalertproperties.md#includesuspendbutton) | `boolean` | When true, the scheduled notification includes a Suspend button |

#### Schedule

| Property | Type | Description |
| --- | --- | --- |
| [CronExpression](https://www.adaptabletools.com/docs/reference/schedule.md#cronexpression) | `string` | Standard 5-field cron (minute hour day-of-month month day-of-week); e.g. weekdays at 09:30 → `30 9 * * 1-5` |
| [IsOneOff](https://www.adaptabletools.com/docs/reference/schedule.md#isoneoff) | `boolean` | `true` runs once, at `RunAt`. `false` repeats on `CronExpression`. |
| [RunAt](https://www.adaptabletools.com/docs/reference/schedule.md#runat) | `string` | ISO datetime for a one-off run (local time); set when IsOneOff is true |

------------------

## Alert Options

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [alertForms](https://www.adaptabletools.com/docs/reference/alertoptions.md#alertforms) | [`AlertForm`](https://www.adaptabletools.com/docs/reference/alertform.md)`<TData>[]` | Full definitions of Alert Forms - the names of which are provided in Alert State |   |
| [alertMessageHeader](https://www.adaptabletools.com/docs/reference/alertoptions.md#alertmessageheader) | `(alertMessageContext: `[`AlertMessageContext`](https://www.adaptabletools.com/docs/reference/alertmessagecontext.md)`<TData>) => string \| undefined` | Function providing Header to display in Alert; if empty, AdapTable provides dynamically |   |
| [alertMessageText](https://www.adaptabletools.com/docs/reference/alertoptions.md#alertmessagetext) | `(alertMessageContext: `[`AlertMessageContext`](https://www.adaptabletools.com/docs/reference/alertmessagecontext.md)`<TData>) => string \| undefined` | Function providing Message to display in Alert; if empty, AdapTable provides dynamically |   |
| [cellHighlightDuration](https://www.adaptabletools.com/docs/reference/alertoptions.md#cellhighlightduration) | `number` | How long (in ms) a Cell will be highlighted when an Alert fires | 2000 |
| [commandHandlers](https://www.adaptabletools.com/docs/reference/alertoptions.md#commandhandlers) | [`CommandHandler`](https://www.adaptabletools.com/docs/reference/commandhandler.md)`<TData>[]` | Custom onClick Handlers for Buttons (displayed in Alert Forms) |   |
| [consolidateBatchAlerts](https://www.adaptabletools.com/docs/reference/alertoptions.md#consolidatebatchalerts) | `boolean` | When a single batch action (e.g. Bulk Update, Smart Edit) triggers multiple Alerts from the<br/>same Alert Definition, consolidate them into a single Alert (with an occurrence count) rather<br/>than showing one Alert per changed cell.<br/><br/>Per-cell effects (cell/row highlighting, console logging, the `AlertFired` event) still fire<br/>for every change; only the &quot;once&quot; effects (the stored Alert, the toast notification and any<br/>jump-to-cell/row) are consolidated. Alerts that use a bespoke Alert Form are never consolidated. | true |
| [dataChangeDetectionPolicy](https://www.adaptabletools.com/docs/reference/alertoptions.md#datachangedetectionpolicy) | [`DataChangeDetectionPolicy`](https://www.adaptabletools.com/docs/reference/datachangedetectionpolicy.md) | Whether Alert rule is evaluated against the `rawValue` or `formattedValue` of the changed cell data | &#39;rawValue&#39; |
| [maxAlertsInStore](https://www.adaptabletools.com/docs/reference/alertoptions.md#maxalertsinstore) | `number` | How many alerts held in State at any one time; when limit is breached, oldest alert will be removed | 20 |
| [rowHighlightDuration](https://www.adaptabletools.com/docs/reference/alertoptions.md#rowhighlightduration) | `number` | How long (in ms) a Row will be highlighted when an Alert Fires | 4000 |
| [showMissingPrimaryKeyAlert](https://www.adaptabletools.com/docs/reference/alertoptions.md#showmissingprimarykeyalert) | `boolean` | Shows Alert if Primary Key column in Adaptable Options is not present or incorrect | false |
| [statusbarHighlightDuration](https://www.adaptabletools.com/docs/reference/alertoptions.md#statusbarhighlightduration) | `number` | How long (in ms) Alert panel in Status Bar highlights when an Alert Fires | 2000 |

`dataChangeDetectionPolicy` is a [`DataChangeDetectionPolicy`](https://www.adaptabletools.com/docs/reference/datachangedetectionpolicy.md):

[See API: datachangedetectionpolicy](https://www.adaptabletools.com/docs/reference/datachangedetectionpolicy.md)

`alertForms` entries are `{ name: string; form: AdaptableForm }`. The form callback receives an [`AlertFormContext`](https://www.adaptabletools.com/docs/reference/alertformcontext.md):

| Property | Type | Description |
| --- | --- | --- |
| [alert](https://www.adaptabletools.com/docs/reference/alertformcontext.md#alert) | [`AdaptableAlert`](https://www.adaptabletools.com/docs/reference/adaptablealert.md)`<TData>` | Alert that has been triggered |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/alertformcontext.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

The form is an [`AdaptableForm`](https://www.adaptabletools.com/docs/reference/adaptableform.md):

Defines the form. `fields` is a list of fields, rows of fields, or field groups. `buttons` are the form buttons. `layout` is `rows` (the default) or `inline`.

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [buttons](https://www.adaptabletools.com/docs/reference/adaptableform.md#buttons) | [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<T>[]` | Buttons to include in the Form |   |
| [description](https://www.adaptabletools.com/docs/reference/adaptableform.md#description) | `string` | Additional information to appear in the Form |   |
| [fields](https://www.adaptabletools.com/docs/reference/adaptableform.md#fields) | `(`[`AdaptableFormField`](https://www.adaptabletools.com/docs/reference/adaptableformfield.md)` \| `[`AdaptableFormField`](https://www.adaptabletools.com/docs/reference/adaptableformfield.md)`[] \| `[`AdaptableFormFieldGroup`](https://www.adaptabletools.com/docs/reference/adaptableformfieldgroup.md)`)[]` | Collection of Dynamic Fields and Field Groups to display.<br/><br/>Items can be:<br/>- a single  (rendered on its own row in the<br/> default `rows` layout, or as one cell in the `inline` layout),<br/>- an array of  (rendered side-by-side on the<br/> same row in the `rows` layout), or<br/>- an  (a labelled section that<br/> visually groups related fields). |   |
| [layout](https://www.adaptabletools.com/docs/reference/adaptableform.md#layout) | [`AdaptableFormLayout`](https://www.adaptabletools.com/docs/reference/adaptableformlayout.md) | How the form&#39;s fields are arranged on screen.<br/><br/>- `rows` (default): each field on its own row, label on the left and<br/> input on the right. Suitable for popups / wizards.<br/>- `inline`: fields are placed side-by-side on a single horizontal line,<br/> with the label rendered immediately before its input. Designed for<br/> compact contexts such as Dashboard Custom Toolbars where vertical<br/> real-estate is scarce. | &#39;rows&#39; |
| [onSubmit](https://www.adaptabletools.com/docs/reference/adaptableform.md#onsubmit) | `(formData: TData, context: T) => void` | Optional form-level submit hook.<br/><br/>Fired when the user presses `Enter` while focus is inside any field<br/>input AND the form is currently valid. The full `formData` is passed<br/>through, typed as `TData` if you&#39;ve supplied a custom shape.<br/><br/>Use this as an ergonomic shortcut to avoid wiring an explicit &quot;Submit&quot;<br/>button - or in addition to one, so power users can press Enter to<br/>commit. If the form is invalid the hook is not invoked. |   |
| [title](https://www.adaptabletools.com/docs/reference/adaptableform.md#title) | `string` | Title to appear in the Form |   |

Each field is an <ApiLink name="AdaptableFormField" link="adaptableformfield"/>:

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [clearToDefault](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#cleartodefault) | `boolean` | For single `select` fields only. When the user clears the combobox,<br/>whether to restore  instead of leaving the field empty.<br/><br/>Defaults to `true` when `defaultValue` is set, otherwise `false`.<br/>Set to `false` when an empty selection is a distinct state from the default. |   |
| [defaultValue](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#defaultvalue) | `string \| boolean \| number \| Array<string \| number \| boolean>` | Field Default Value - can be of type string, boolean, number, or for<br/>`select` fields with `multi: true` an array of those.<br/><br/>For single `select` fields, this is also the value restored when the user<br/>clears the combobox (unless  is `false`). |   |
| [disabled](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#disabled) | `boolean \| ((formData: `[`AdaptableFormData`](https://www.adaptabletools.com/docs/reference/adaptableformdata.md)`, context: `[`BaseContext`](https://www.adaptabletools.com/docs/reference/basecontext.md)`) => boolean)` | Disable the field&#39;s input. Either a boolean or a function evaluated<br/>against the current form data. Disabled fields render but the user<br/>cannot edit them. |   |
| [fieldType](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#fieldtype) | [`AdaptableFormFieldType`](https://www.adaptabletools.com/docs/reference/adaptableformfieldtype.md) | Field Type - dictates which UI control is rendered |   |
| [helpText](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#helptext) | `string` | Inline help text rendered immediately below the field&#39;s input. Useful<br/>for short explanations such as &quot;format: YYYY-MM-DD&quot; or &quot;min 3 chars&quot;. |   |
| [hidden](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#hidden) | `boolean \| ((formData: `[`AdaptableFormData`](https://www.adaptabletools.com/docs/reference/adaptableformdata.md)`, context: `[`BaseContext`](https://www.adaptabletools.com/docs/reference/basecontext.md)`) => boolean)` | Hide the field. Either a boolean or a function evaluated against the<br/>current form data. Hidden fields are not rendered and are excluded from<br/>validation. |   |
| [label](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#label) | `string` | Label to display in the Field |   |
| [max](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#max) | `number \| string` | Maximum allowed value. For `number` and `slider`: the highest accepted<br/>number. For `date`, `time` and `datetime`: the latest allowed value in<br/>ISO format. |   |
| [maxLength](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#maxlength) | `number` | Maximum length for `text` and `textarea` fields. |   |
| [min](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#min) | `number \| string` | Minimum allowed value. For `number` and `slider`: the lowest accepted<br/>number. For `date`, `time` and `datetime`: the earliest allowed value<br/>in ISO format (`YYYY-MM-DD` / `HH:mm` / `YYYY-MM-DDTHH:mm`). |   |
| [minLength](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#minlength) | `number` | Minimum length for `text` and `textarea` fields. |   |
| [multi](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#multi) | `boolean` | For `select` fields only. When `true` the field renders as a<br/>multi-select combobox; the field&#39;s value is an array of selected<br/>`option.value`s rather than a single value. | false |
| [name](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#name) | `string` | Name of the Field |   |
| [onValueChange](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#onvaluechange) | `(value: any, context: `[`BaseContext`](https://www.adaptabletools.com/docs/reference/basecontext.md)`) => void` | Optional callback invoked whenever value of this field changes |   |
| [options](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#options) | [`AdaptableFormFieldOption`](https://www.adaptabletools.com/docs/reference/adaptableformfieldoption.md)`[] \| ((formData: `[`AdaptableFormData`](https://www.adaptabletools.com/docs/reference/adaptableformdata.md)`, context: `[`BaseContext`](https://www.adaptabletools.com/docs/reference/basecontext.md)`) => `[`AdaptableFormFieldOption`](https://www.adaptabletools.com/docs/reference/adaptableformfieldoption.md)`[] \| Promise<`[`AdaptableFormFieldOption`](https://www.adaptabletools.com/docs/reference/adaptableformfieldoption.md)`[]>)` | Items to populate the `select` and `radio` fieldTypes.<br/><br/>Either a static array, or a function that derives the options from the<br/>current form data and Adaptable context. The function form may return<br/>a Promise for asynchronously-loaded options - the form will render the<br/>field with no items until the promise resolves. |   |
| [pattern](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#pattern) | `string` | Regular expression that the value of a `text` field must match. |   |
| [placeholder](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#placeholder) | `string` | Placeholder text shown inside `text`, `textarea`, `number`, `date`,<br/>`time` and `datetime` inputs when empty. For `select` fields it is<br/>rendered as the empty-state label when no value is selected.<br/><br/>When omitted on a `select` field with a , the label of<br/>the matching `options` entry is used as the empty-state label. |   |
| [render](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#render) | `(params: `[`AdaptableFormFieldRenderParams`](https://www.adaptabletools.com/docs/reference/adaptableformfieldrenderparams.md)`) => React.ReactNode` | For `custom` fields only. Renders an arbitrary React node as the<br/>field&#39;s input. Receives the current value, a `setValue` setter<br/>(controlled), the current form data, the Adaptable context and the<br/>resolved `disabled` state.<br/><br/>Use this as an escape hatch when none of the built-in `fieldType`s<br/>fit - e.g. to render a star-rating widget, a tag editor or any<br/>bespoke control. |   |
| [required](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#required) | `boolean` | If `true` the field is treated as required. An empty value (`''`,<br/>`null`, `undefined`, or unchecked checkbox) will produce a validation<br/>error. |   |
| [rows](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#rows) | `number` | For `textarea` fields: the visible number of text rows. | 3 |
| [step](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#step) | `number` | Stepping interval for `number`, `slider`, `time` and `datetime`<br/>fields. |   |
| [tooltip](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#tooltip) | `string` | Tooltip shown when hovering the field&#39;s label. |   |
| [validate](https://www.adaptabletools.com/docs/reference/adaptableformfield.md#validate) | `(value: any, formData: `[`AdaptableFormData`](https://www.adaptabletools.com/docs/reference/adaptableformdata.md)`, context: `[`BaseContext`](https://www.adaptabletools.com/docs/reference/basecontext.md)`) => string \| null \| undefined` | Custom field-level validation. Return an error message string to mark<br/>the field invalid, or `null`/`undefined` if the value is valid.<br/><br/>Custom validation runs *after* built-in checks (`required`, `min`,<br/>`max`, `pattern`, etc.) - the first failing check wins. |   |

`fieldType` is an <ApiLink name="AdaptableFormFieldType" link="adaptableformfieldtype"/>:

[See API: adaptableformfieldtype](https://www.adaptabletools.com/docs/reference/adaptableformfieldtype.md)

Select and radio `options` are <ApiLink name="AdaptableFormFieldOption" link="adaptableformfieldoption"/> objects:

| Property | Type | Description |
| --- | --- | --- |
| [label](https://www.adaptabletools.com/docs/reference/adaptableformfieldoption.md#label) | `string` | Text shown for this choice. |
| [value](https://www.adaptabletools.com/docs/reference/adaptableformfieldoption.md#value) | `any` | Value written into the form data when this choice is selected. |

`layout` is an <ApiLink name="AdaptableFormLayout" link="adaptableformlayout"/>:

[See API: adaptableformlayout](https://www.adaptabletools.com/docs/reference/adaptableformlayout.md)

`buttons` are <ApiLink name="AdaptableButton" link="adaptablebutton"/> objects:

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [buttonStyle](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#buttonstyle) | [`ButtonStyle`](https://www.adaptabletools.com/docs/reference/buttonstyle.md)` \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => `[`ButtonStyle`](https://www.adaptabletools.com/docs/reference/buttonstyle.md)`)` | Style for Button - can be object or function that provides a `ButtonStyle` object |   |
| [disabled](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#disabled) | `(button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean` | Function that disables / enables the button based on its evaluation result |   |
| [hidden](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#hidden) | `(button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean` | Function which sets whether Button is hidden |   |
| [icon](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#icon) | [`AdaptableIcon`](https://www.adaptabletools.com/docs/reference/adaptableicon.md)` \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => `[`AdaptableIcon`](https://www.adaptabletools.com/docs/reference/adaptableicon.md)`)` | Icon for Button - can be object or function that provides a `AdaptableIcon` object |   |
| [iconPosition](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#iconposition) | `'start' \| 'end'` | Where the icon appears relative to the label | &#39;start&#39; |
| [label](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#label) | `string \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => string)` | Label for Button - can be string or function that provides string |   |
| [onClick](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#onclick) | `(button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => void` | Function to invoke when button is clicked |   |
| [tooltip](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#tooltip) | `string \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => string)` | Tooltip for Button - can be string or function that provides string |   |

`buttonStyle` is a <ApiLink name="ButtonStyle" link="buttonstyle"/>:

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [className](https://www.adaptabletools.com/docs/reference/buttonstyle.md#classname) | `string` | CSS Classname to use for the Button |   |
| [tone](https://www.adaptabletools.com/docs/reference/buttonstyle.md#tone) | `'success' \| 'error' \| 'neutral' \| 'none' \| 'warning' \| 'info' \| 'accent'` | Button&#39;s Tone - values: &#39;success&#39;, &#39;error&#39;, &#39;neutral&#39;, &#39;none&#39;, &#39;warning&#39;, &#39;info&#39;, &#39;accent&#39; | &#39;neutral&#39; |
| [variant](https://www.adaptabletools.com/docs/reference/buttonstyle.md#variant) | `'text' \| 'outlined' \| 'raised'` | How Button appears - values: &#39;text&#39;, &#39;outlined&#39;, &#39;raised&#39; | &#39;outlined&#39; |

`commandHandlers` entries are `{ name: string; handler: (button, context: AlertFormContext) => void }`.

------------------------

## Alert API

Full programmatic access to Alerts and related features is available in [Alert API](https://www.adaptabletools.com/docs/technical-reference-alerting/index.md).

This enables Alerts to be accessed, created, edited, deleted and shared programmatically.

| Method | Returns | Description |
| --- | --- | --- |
| [addAlertDefinition(alertDefinition)](https://www.adaptabletools.com/docs/reference/alertapi.md#addalertdefinition) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md) | Adds given Alert Definition to Adaptable State |
| [applyScheduledAlertDefinition(alertDefinition)](https://www.adaptabletools.com/docs/reference/alertapi.md#applyscheduledalertdefinition) | `void` | Fires a scheduled Alert Definition now: its notification, system status message, or other behaviour. |
| [deleteAlertDefinition(alertDefinition)](https://www.adaptabletools.com/docs/reference/alertapi.md#deletealertdefinition) | `void` | Deletes given Alert Definition from Adaptable State |
| [displayAdaptableAlert(alertToShow)](https://www.adaptabletools.com/docs/reference/alertapi.md#displayadaptablealert) | `Promise<void>` | Displays the given Adaptable Alert. |
| [displayAdaptableAlertNotification(alert)](https://www.adaptabletools.com/docs/reference/alertapi.md#displayadaptablealertnotification) | `void` | Displays given Alert as a Toast |
| [editAlertDefinition(alertDefinition)](https://www.adaptabletools.com/docs/reference/alertapi.md#editalertdefinition) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md) | Updates given Alert Definition in Adaptable State |
| [evaluateAlertDefinitions(alertDefinitions)](https://www.adaptabletools.com/docs/reference/alertapi.md#evaluatealertdefinitions) | `void` | Evaluates the given Alert Definitions - will fire Alert if rule is met |
| [findAlertDefinitions(alertLookupCriteria)](https://www.adaptabletools.com/docs/reference/alertapi.md#findalertdefinitions) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md)`[]` | Find all Alert Definitions which match the given criteria |
| [getActiveAlertDefinitions()](https://www.adaptabletools.com/docs/reference/alertapi.md#getactivealertdefinitions) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md)`[]` | Alert Definitions that are currently active (not suspended). |
| [getAlertDefinitionById(id)](https://www.adaptabletools.com/docs/reference/alertapi.md#getalertdefinitionbyid) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md) | Retrieves alert definition by the technical ID (from `AlertState`) |
| [getAlertDefinitionByName(name)](https://www.adaptabletools.com/docs/reference/alertapi.md#getalertdefinitionbyname) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md)` \| undefined` | Retrieves an Alert Definition by its Name |
| [getAlertDefinitions()](https://www.adaptabletools.com/docs/reference/alertapi.md#getalertdefinitions) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md)`[]` | Retrieves all Alert Definitions in Alert State |
| [getAlertRuleState(alertDefinition, rowNode)](https://www.adaptabletools.com/docs/reference/alertapi.md#getalertrulestate) | `'Normal' \| 'Firing' \| undefined` | Current reading of a live Alert rule — one reading change history<br/>(`CHANGE_COUNT{[price], WITHIN(5m)} >= 3`) or the clock. `'Firing'` while<br/>the rule holds for `rowNode` (per-row rules) or for the grid (grid-level<br/>rules; `rowNode` ignored); `'Normal'` otherwise. `undefined` for<br/>non-live, suspended or never-evaluated definitions / rows. |
| [getAlertState()](https://www.adaptabletools.com/docs/reference/alertapi.md#getalertstate) | [`AlertState`](https://www.adaptabletools.com/docs/reference/alertstate.md) | Retrieves Alert section from Adaptable State |
| [getSuspendedAlertDefinitions()](https://www.adaptabletools.com/docs/reference/alertapi.md#getsuspendedalertdefinitions) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md)`[]` | Alert Definitions that are currently suspended. |
| [openAlertSettingsPanel(tab)](https://www.adaptabletools.com/docs/reference/alertapi.md#openalertsettingspanel) | `void` | Opens the Settings Panel on the Alert page.<br/><br/>The Alert page has two tabs: `'Alerts'` (the live / triggered alerts) and<br/>`'Alert Definitions'` (the alert configuration). Pass `tab` to open a specific tab.<br/>When omitted, it opens the `'Alerts'` tab if there are any live alerts, otherwise the<br/>`'Alert Definitions'` tab. |
| [showAlert(alertHeader, alertMessage, messageType, alertProperties)](https://www.adaptabletools.com/docs/reference/alertapi.md#showalert) | `Promise<void>` | Creates Alert based on given parameters and displays it. |
| [showAlertError(alertHeader, alertMessage)](https://www.adaptabletools.com/docs/reference/alertapi.md#showalerterror) | `Promise<void>` | Creates an Adaptable Alert based on given parameters and displays it as Error Alert. |
| [showAlertInfo(alertHeader, alertMessage)](https://www.adaptabletools.com/docs/reference/alertapi.md#showalertinfo) | `Promise<void>` | Creates an Adaptable Alert based on given parameters and displays it as Info Alert. |
| [showAlertSuccess(alertHeader, alertMessage)](https://www.adaptabletools.com/docs/reference/alertapi.md#showalertsuccess) | `Promise<void>` | Creates an Adaptable Alert from the header and message and displays it as a Success alert. |
| [showAlertWarning(alertHeader, alertMessage)](https://www.adaptabletools.com/docs/reference/alertapi.md#showalertwarning) | `Promise<void>` | Creates an Adaptable Alert based on given parameters and displays it as Warning Alert. |
| [suspendAlertDefinition(alertDefinition)](https://www.adaptabletools.com/docs/reference/alertapi.md#suspendalertdefinition) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md) | Suspends Alert Definition |
| [suspendAllAlertDefinition()](https://www.adaptabletools.com/docs/reference/alertapi.md#suspendallalertdefinition) | `void` | Suspends all Alert Definitions |
| [unSuspendAlertDefinition(alertDefinition)](https://www.adaptabletools.com/docs/reference/alertapi.md#unsuspendalertdefinition) | [`AlertDefinition`](https://www.adaptabletools.com/docs/reference/alertdefinition.md) | Activates a suspended Alert Definition |
| [unSuspendAllAlertDefinition()](https://www.adaptabletools.com/docs/reference/alertapi.md#unsuspendallalertdefinition) | `void` | Activates all suspended Alert Definition |

------------------

## Alert Fired Event

The Alert Fired Event is published by AdapTable whenever an Alert is fired.

The event comprises the [`AlertFiredInfo`](https://www.adaptabletools.com/docs/reference/alertfiredinfo.md) object which contains a single property:

| Property | Type | Description |
| --- | --- | --- |
| [alert](https://www.adaptabletools.com/docs/reference/alertfiredinfo.md#alert) | [`AdaptableAlert`](https://www.adaptabletools.com/docs/reference/adaptablealert.md) | Alert that was displayed.<br/><br/>A cell or row Alert includes the change that triggered it. A generic Alert is the message only. |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/alertfiredinfo.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

This is of type [`AdaptableAlert`](https://www.adaptabletools.com/docs/reference/adaptablealert.md) which has 2 flavours:

- Cell Changed Alert
- Row Changed Alert

### Cell Changed Alert

This is fired when a Cell in AdapTable is changed — either manually or via ticking data.

It is of type [`AdaptableCellChangedAlert`](https://www.adaptabletools.com/docs/reference/adaptablecellchangedalert.md) and contains a single `cellDataChangedInfo` property:

| Property | Type | Description |
| --- | --- | --- |
| [cellDataChangedInfo](https://www.adaptabletools.com/docs/reference/adaptablecellchangedalert.md#celldatachangedinfo) | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md)`<TData>` | Cell DataChange which triggered Alert<br/><br/>For a consolidated batch Alert this is the first affected cell (jump-to-cell lands here). |
| [cellDataChangedInfos](https://www.adaptabletools.com/docs/reference/adaptablecellchangedalert.md#celldatachangedinfos) | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md)`<TData>[]` | All cell changes represented by this Alert when several changes from one batch<br/>action were consolidated (`occurrenceCount`  1). The first entry matches<br/>.<br/><br/>Used so cell / row highlighting still applies to every affected cell. |

This property is of type [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md) and contains full details of the Cell Change:

| Property | Type | Description |
| --- | --- | --- |
| [changedAt](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#changedat) | `number` | Timestamp of change occurrence (in milliseconds) |
| [column](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#column) | [`AdaptableColumn`](https://www.adaptabletools.com/docs/reference/adaptablecolumn.md)`<TData>` | Column in which cell is situated |
| [newValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#newvalue) | `any` | Value after the change.<br/><br/>Absent when `trigger` is `live`. |
| [oldValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#oldvalue) | `any` | Value before the change.<br/><br/>Absent when `trigger` is `live`. |
| [preventEdit](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#preventedit) | `boolean` | Whether the change was prevented by a validation rule |
| [primaryKeyValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#primarykeyvalue) | `any` | Primary Key Column&#39;s value for the row where edited cell is situated |
| [rowData](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#rowdata) | `TData` | Data in the Row |
| [rowNode](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#rownode) | `IRowNode<TData>` | AG Grid RowNode that contains the cell |
| [trigger](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#trigger) | `'edit' \| 'tick' \| 'undo' \| 'aggChange' \| 'calculatedColumnChange' \| 'live'` | What triggered the change - user, background change, a reverted change, a<br/>derived update on a Calculated Column whose source value changed, or a<br/>live Alert rule turning true for the row (`live`: no old / new value,<br/>`column` is the rule&#39;s first Scope column when it has one). |

### Row Changed Alert

This is fired when a Row in AdapTable has been added, updated or deleted.

It is of type [`AdaptableRowChangedAlert`](https://www.adaptabletools.com/docs/reference/adaptablerowchangedalert.md) and contains a single `rowDataChangedInfo` property:

| Property | Type | Description |
| --- | --- | --- |
| [rowDataChangedInfo](https://www.adaptabletools.com/docs/reference/adaptablerowchangedalert.md#rowdatachangedinfo) | [`RowDataChangedInfo`](https://www.adaptabletools.com/docs/reference/rowdatachangedinfo.md)`<TData>` | Row DataChange which triggered Alert |

This property is of type [`RowDataChangedInfo`](https://www.adaptabletools.com/docs/reference/rowdatachangedinfo.md) and contains full details of the Row in question:

| Property | Type | Description |
| --- | --- | --- |
| [changedAt](https://www.adaptabletools.com/docs/reference/rowdatachangedinfo.md#changedat) | `number` | Timestamp of change occurrence (in milliseconds) |
| [dataRows](https://www.adaptabletools.com/docs/reference/rowdatachangedinfo.md#datarows) | `TData[]` | Data rows that have been added, updated, or deleted |
| [rowNodes](https://www.adaptabletools.com/docs/reference/rowdatachangedinfo.md#rownodes) | `IRowNode<TData>[]` | Row Nodes that were affected by this change |
| [rowTrigger](https://www.adaptabletools.com/docs/reference/rowdatachangedinfo.md#rowtrigger) | [`RowDataChangeTrigger`](https://www.adaptabletools.com/docs/reference/rowdatachangetrigger.md) | Trigger for row change: Load, Add, Update, or Delete |

`rowTrigger` is a [`RowDataChangeTrigger`](https://www.adaptabletools.com/docs/reference/rowdatachangetrigger.md):

[See API: rowdatachangetrigger](https://www.adaptabletools.com/docs/reference/rowdatachangetrigger.md)

### Event Subscription

Subscribing to the Event is done the same way as with all [Adaptable Events](https://www.adaptabletools.com/docs/technical-reference-adaptable-events/index.md):

```ts
api.eventApi.on('AlertFired', (eventInfo: AlertFiredInfo) => {
    // do something with the info
});
```

See [Listening to Alerts](https://www.adaptabletools.com/docs/handbook-alerting-alert-fired-event/index.md) for a worked example
