The CreatorCon Call for Content is officially open! Get started here.

How to display warning message when propose solution ui action is clicked on case

Luke James
Tera Contributor

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

2 REPLIES 2

Sanket Landge
Tera Expert

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

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 "

new global.StateFlow().processFlow(current, '8db14a63c3123100d6d210c422d3ae7a', 'manual');". 
 
Does this need modifying?