Flash messages, also known as popup or toast messages, are used for communication with users and to inform them of important changes or errors that have occurred while they interacted with record form.
To set up a new flash message that is not in the "out-of-the-box" installation, you need to:
All flash message texts are stored in the Source Messages (source_message) table.
To create a new message, complete the following steps:
You can also add translations of this message to any language. See more in the Localization and Multi-Language Support article.
To display a plain text message when a business rule is executed, configure the following parameters in the business rule record:
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.
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:
(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); |
(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); |