Control Visibility of Related List Action "New" button based on Form Data

Matt Cordero1
Tera Guru

I have a Related List and I am trying to restrict the visibility of the OOB "New" button, based on the form's status ("Draft" or "Rejected to Draft").  I have tried applying Data Conditions on the Create ACL for the table, but adding any Data Condition hides the "New" button completely.  What is the proper method to hide the "New" button on the Related List so it only appears when form's status is "Draft" or "Rejected to Draft"?

 

NOTE: This is within a Scoped Application.

 

Screenshot:

MattCordero1_0-1744029098260.png

 

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

HI @Matt Cordero1 

 

Best is via list control

 

https://www.servicenow.com/community/developer-forum/hide-related-list-ui-action/m-p/2591454

https://www.servicenow.com/community/developer-forum/how-to-hide-custom-ui-action-on-a-specific-rela...

https://www.servicenow.com/community/itsm-forum/hide-ui-action-on-one-related-list-created-by-relati...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Prathamesh26
Tera Expert

Hi @Matt Cordero1 

 

Please check below link

Link - https://www.servicenow.com/community/next-experience-articles/configuring-lists-in-configurable-work...

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Prathamesh

Ankur Bawiskar
Tera Patron
Tera Patron

@Matt Cordero1 

can you share the complete screenshot?

that New button you are showing is on list on some portal?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Robert H
Mega Sage

Hello @Matt Cordero1 ,

 

Step 1: right click on the header of the related list table, then select Configure > List Control

RobertH_0-1744030866554.png

 

Step 2: in the "Omit new condition" field add the condition for hiding the New button, using the "parent" object to refer to the attributes of the record shown on the current form.

 

For example:

answer = (parent.status == 'draft' || parent.status == 'rejected_to_draft');

 

Regards,

Robert