UI action 'New' on incident

MukeshRK
Kilo Explorer

How can I hide the "New" UI Action on a related list based on the parent record's state?

On the Incident form, we have a related list showing Child Incidents. This related list includes a "New" UI Action (button). I want to hide this "New" button whenever the parent Incident is in the On Hold state. What's the best way to achieve this?

2 REPLIES 2

Sarthak Kashyap
Mega Sage

Hi @MukeshRK ,

 

I tried your problem in my PDI and it works for me, please check below solution 

 

Right click on any column of child incident related list and select list layout

SarthakKashyap_0-1783359935636.png

 

SarthakKashyap_1-1783359959298.png

 

Add this one liner script and it will work 

answer = (parent.state!=3)?false:true;
 
Result
Incident 1990 is onHold 
SarthakKashyap_2-1783360014453.png

and now check the related list for this

SarthakKashyap_3-1783360042775.png

 
Same for Incident 9009 state is New now check the related list 

 

SarthakKashyap_4-1783360066773.png

 

SarthakKashyap_5-1783360091912.png

 

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,

Sarthak 

Tanushree Maiti
Tera Patron

Hi @MukeshRK 

 

 

  • Open the parent Incident form.
  • Scroll down to the Child Incidents related list.
  • Right-click the header of the related list and select Configure > List Control.
  • Under the List Control form, check the box for Omit new button.
  • In the Omit new condition script field that appears, add the following script: answer = (parent.state == 3); //update with correct state
  • Click on update.

 

Refer: https://www.youtube.com/watch?v=3V6lszRGof4

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
For More Information, please check details below: In this session, I have explained how to Hide New Button from Related Lists using List Control. ==========================LIST CONTROL============================ Table - Requested Item Related List - sc_task.request_item Script - if ...