How to grayed out the New, Edit Buttons in Child incidents Tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 03:05 AM
HI
Can some one please help on this below requirement,
I want to grayed out the Buttons (New, Edit) in child incidents tab , if the current incident that i opened is a child (in simple user can't add child to another child incident)
If for example, Inc123 is a child incident and if i open that Inc123 below New and Edit buttons should be Grayed out in child incidents tab
Thanks in Adnvance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 03:55 AM
Why not create a UI policy to hide the related list when it's a child incident? You will never have childs on childs, so why show it?
An example can be found here: https://www.servicenow.com/community/developer-forum/how-to-hide-a-related-lists-based-on-certain-co...
Next to that: you can hide the buttons, but not gray them out, as far as I know.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 12:49 AM
Thanks for Response , it was Really Helpful

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 04:38 AM
Hi @harinya ,
I tried your problem in my PDI and it's works for me
Right click on header of related list and open List Control
Add below code in Omit New Condition and Omit Edit Condition
var answer ;
gs.log("Checck log incidnet 111 = " + current.sys_id);
gs.log("Checck log incidnet 222 = " + parent.child_incidents);
if (parent.child_incidents <= 0) { //Do not remove the 'New' button
answer = false ;
}
else { //Remove the 'New' button
answer = true ;
}
answer ;
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 12:49 AM
Thanks for Response