I need to call a UI Message in Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2017 07:45 AM
Hi all,
I have a Requirement as "When trying to cancel a incident record with an active incident task an error message should be thrown to prompt the
user as 'Kindly close/cancel the associated incident tasks to cancel the incident''
For this I wrote a Business Rule & the same is working fine but without display message.
I have created a Message in SYSTEM UI > MESSAGES and the same i need to call in the Business rule . But the script which i have wrote is not
displaying prompt message
The script which i have written in Business Rule is as follows,
var inc = new GlideRecord('incident_task');
var thisincident = current.sys_id;
inc.addQuery('incident',thisincident);
inc.addQuery('active',true);
inc.query();
while (inc.next()) {
gs.getMessage('Kindly_close/cancel_the_ associated_incident_tasks_to_cancel_the_incident');
current.setAbortAction(true);
}
Kindly help me to call a message "Kindly close/cancel the associated incident tasks to cancel the incident'' which i have created in SYSTEM UI>MESSAGES
in the Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2017 07:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2017 07:51 AM
You are calling the message but what are you doing with it,
Do this
gs.addInfoMessage(gs.getMessage('Kindly_close/cancel_the_ associated_incident_tasks_to_cancel_the_incident'));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2017 09:55 PM
Thanks David.
Its working fine.
On 3 August 2017 at 20:22, t_anurag <community-no-reply@servicenow.com>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2017 11:27 AM
Its working fine.
That's great. Could you possibly mark the question answered, then? Just in case it's of help to others.