We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

UI action 'New' on incident

MukeshRK
Kilo Contributor

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?

1 ACCEPTED SOLUTION

RaghavendraGund
Tera Contributor

Hello Mukesh 

There is something called LIST control, you script in there as per requirement
Step 1:  Go to Application Navigator(Type in sys_ui_list_control.LIST  refer screenshot 1)or you got List Control on the incident form itself.
Step2: enter the script in the omit new condition and save.

Please Mark Helpful if it helps you!!

View solution in original post

5 REPLIES 5

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 ...

RaghavendraGund
Tera Contributor

Hello Mukesh 

There is something called LIST control, you script in there as per requirement
Step 1:  Go to Application Navigator(Type in sys_ui_list_control.LIST  refer screenshot 1)or you got List Control on the incident form itself.
Step2: enter the script in the omit new condition and save.

Please Mark Helpful if it helps you!!

Thanks this worked