Display an alert message that Incident is breached when ever we open that breached incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2018 11:31 PM
Display an alert message that Incident is breached when ever we open that breached incident?
- Labels:
-
User Experience and Design

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2018 11:39 PM
Hi
Is there any field on your incident form that tells it is breached? If not create a field on incident table which tells you it is breached.
Write script include to set that field to true(if breached) or false.
And then create a onLoad client script to check the value of the field you create and display an message in case.
Your business rule will look something like this :-
Try using below business rule on Task SLA (task_sla) table which runs after update when Has Breached changes to True
var incisla=new GlideRecord('incident');
incisla.addQuery('sys_id',current.task);
incisla.query();
while(incisla.next())
{
gs.log('In loop');
current.inci_breached=true; //considering inci_breached is the checkbox field name on incident form.
incisla.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 01:19 AM
Thanks for your reply, just one question can we do this by using display business rule & a client script, as SLA table is there in incident form as related list and there is a variable in it has breached which is by default is false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 02:14 AM
Hi
Yes definitely. You need to set the value of breached in g_scratchpad in display business rule and use the same in onLoad client script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2018 11:48 PM
You can have an onload client script and use script include in that to check task_sla record status for this incident and return the response and based on that you can display an alert or an addInfoMessage onto the form sometimes an alert might not work or work irrespective of condition if you use getXML() for asynchronous processing .Either use getXMLWait() if that issue pops up but note that it will not work in service portal or use an addInfoMessage that will be stayed and will be user friendly
Thanks,
Siva
Mark this answer as correct if that helps 🙂