Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Merged branch "DOC0001122" into parent

Flash messages, also known as popup or toast messages, are used to communicate for communication with users and to inform them of important changes or errors that have occurred while they interact interacted with record formsform.

Image Added

To set up a new flash message that is not in the "out-of-the-box" installation, you need to:

  1. Create a source message.
  2. Create message translations.
  3. Configure the business rule whose conditions trigger the message displaySelect the system element that the user needs to interact with in order to trigger the flash message and configure the logic for it.

Create a source message


All flash message texts are stored in the Source Messages (source_message) table.

To create a new flash message, complete the following steps: 

  1. Navigate to System Localization → Source Messages.
  2. Click New and fill in the Message field.
  3. Click Save or Save and exit.
note

The text of the source message must be in English.

You can also add translations of this message to any language. See more in the Localization and Multi-Language Support article.

Configure a business rule


To display the a plain text message when a business rule is executed, configure the following parameters when creating or updating a in the business rule record:

  1. On the Action tab, select the Add message checkbox.
In the Message field that appears, enter the message you need.
  1. Enter the
message
  1. Message text from the Source Messages table
for it to be localized.
  1. to have it localized.

If you need to add variables or dynamic links to other records in the message text, configure a script with the Advanced settings. You can specify the selection of the appropriate translation based on the user's locale in the script. 

See the Business Rules article to learn more.  

Configure a script


To add a flash message with a script, open the form of a record to which the message should be connected and find the Script field. You can use variables, dynamic links and translations in the flash messages.

The list of methods that can be used in the business rule to add a message:

Code Block
languagejs
themeConfluence
titleA flash message script with a link
linenumberstrue
(function executeRule(current, previous = null /*not null only when action is update*/) {
const iaStats = new SimpleRecord('instance_activity_stats');
iaStats.get('ci_instance', current.sys_id);
if(iaStats.sys_id){
  iaStats.active = false;
  iaStats.update();
  ss.addInfoMessage(IAStats <a href="/record/instance_activity_stats/${iaStats.sys_id}" target="_blank"><span style="color: #0050C8;">${iaStats.getDisplayValue()}</span></a> deactivated.)
}
})(current, previous);


Code Block
languagejs
themeConfluence
titleA flash message script with a translation
linenumberstrue
(function executeRule(current, previous = null /*not null only when action is update*/) {
  const message = new SimpleMessage();
  const localizedMessage = message.getMessage('Inherits property has been activated for global UI action');
  ss.addInfoMessage(localizedMessage);
})(current, previous);
For more information about creating business rules, see Business Rules.


Table of Contents
absoluteUrltrue
classfixedPosition
printablefalse