How to display warning message when propose solution ui action is clicked on case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 09:16 AM
Hi All,
I have a requirement where on a case if a user clicks the propose solution ui action, ServiceNow checks to see if there is a related incident that is open, if there is, it needs to display a warning message and to abort the action of the ui action.
Any ideas on how to do this?
Kind Regards,
Luke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 09:44 AM
Hello @Luke James,
You can add the server side code to check the related incident count by using following code.
var incGR = new GlideRecord("incident")
incGR.addQuery("parent",current.sys_id);
incGR.query();
if(incGR.getRowCount()>0){
gs.addErrorMessage("your_warning_message")
}
Please mark helpful/correct if this worked.
Regards,
Sanket Landge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 09:52 AM
Hi @Sanket Landge , thanks for your reply. Is this in the ui action script itself?
The current script in the ootb ui action has this line of code "