# AlertOptions

Canonical page: https://www.adaptabletools.com/docs/reference/alertoptions

Options related to Alerts in Adaptable.

```ts title="TypeScript"
export interface AlertOptions<TData = any> 
```

## Properties

| 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 |

## Property Details

### alertForms

Full definitions of Alert Forms - the names of which are provided in Alert State

```ts title="TypeScript"
alertForms?: AlertForm<TData>[];
```

###### Property Value

[`AlertForm`](https://www.adaptabletools.com/docs/reference/alertform.md)`<TData>[]`

### alertMessageHeader

Function providing Header to display in Alert; if empty, AdapTable provides dynamically

```ts title="TypeScript"
alertMessageHeader?: (alertMessageContext: AlertMessageContext<TData>) => string | undefined;
```

###### Property Value

`(alertMessageContext: `[`AlertMessageContext`](https://www.adaptabletools.com/docs/reference/alertmessagecontext.md)`<TData>) => string | undefined`

### alertMessageText

Function providing Message to display in Alert; if empty, AdapTable provides dynamically

```ts title="TypeScript"
alertMessageText?: (alertMessageContext: AlertMessageContext<TData>) => string | undefined;
```

###### Property Value

`(alertMessageContext: `[`AlertMessageContext`](https://www.adaptabletools.com/docs/reference/alertmessagecontext.md)`<TData>) => string | undefined`

### cellHighlightDuration

How long (in ms) a Cell will be highlighted when an Alert fires

```ts title="TypeScript"
cellHighlightDuration?: number;
```

###### Default Value

2000

###### Property Value

`number`

### commandHandlers

Custom onClick Handlers for Buttons (displayed in Alert Forms)

```ts title="TypeScript"
commandHandlers?: CommandHandler<TData>[];
```

###### Property Value

[`CommandHandler`](https://www.adaptabletools.com/docs/reference/commandhandler.md)`<TData>[]`

### consolidateBatchAlerts

When a single batch action (e.g. Bulk Update, Smart Edit) triggers multiple Alerts from the
same Alert Definition, consolidate them into a single Alert (with an occurrence count) rather
than showing one Alert per changed cell.

Per-cell effects (cell/row highlighting, console logging, the `AlertFired` event) still fire
for every change; only the &quot;once&quot; effects (the stored Alert, the toast notification and any
jump-to-cell/row) are consolidated. Alerts that use a bespoke Alert Form are never consolidated.

```ts title="TypeScript"
consolidateBatchAlerts?: boolean;
```

###### Default Value

true

###### Property Value

`boolean`

### dataChangeDetectionPolicy

Whether Alert rule is evaluated against the `rawValue` or `formattedValue` of the changed cell data

```ts title="TypeScript"
dataChangeDetectionPolicy?: DataChangeDetectionPolicy;
```

###### Default Value

&#39;rawValue&#39;

###### Property Value

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

### maxAlertsInStore

How many alerts held in State at any one time; when limit is breached, oldest alert will be removed

```ts title="TypeScript"
maxAlertsInStore?: number;
```

###### Default Value

20

###### Property Value

`number`

### rowHighlightDuration

How long (in ms) a Row will be highlighted when an Alert Fires

```ts title="TypeScript"
rowHighlightDuration?: number;
```

###### Default Value

4000

###### Property Value

`number`

### showMissingPrimaryKeyAlert

Shows Alert if Primary Key column in Adaptable Options is not present or incorrect

```ts title="TypeScript"
showMissingPrimaryKeyAlert?: boolean;
```

###### Default Value

false

###### Property Value

`boolean`

### statusbarHighlightDuration

How long (in ms) Alert panel in Status Bar highlights when an Alert Fires

```ts title="TypeScript"
statusbarHighlightDuration?: number;
```

###### Default Value

2000

###### Property Value

`number`
