# getAlert()

Messages can be displayed with the function `getAlert()`. Let's say you want to display the message "Your change has been successfully saved" in a green bar, then use the function as follows:

```cfscript
getAlert('Your change has been successfully saved')
```

You can also work with the language variables from the table "system\_translations" as well as "custom\_translations" here, or with your own sentences. If you want to use such a language variable, simply write:

```cfscript
getAlert('txtActivateThisUser')
```

You can also specify the color of the bar by adding one of the following attributes:

* info (<mark style="color:blue;">blue</mark>)
* warning (<mark style="color:orange;">orange</mark>)
* danger (<mark style="color:red;">red</mark>)
* success (default, <mark style="color:green;">green</mark>)

Example:

```cfscript
getAlert('alertErrorOccured', 'danger')
```

Without any attribute, green (success) is used by default.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saaster.io/development/develop-with-saaster/global-functions/getalert.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
