- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2020 01:16 AM
I have requirement to hide Edit button from Related list for all ITIL except for one specific catalog item, as this Edit UI Action button is a global UI action how can I achieve this?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2020 03:12 AM
you can configure list control and add "Omit edit condition" script field on form layout if not already present.
1) Visit the RITM form
2) Configure list control for that Approvers related list
3) Add script mentioned below
4) No need to update the global UI action
If it evaluates to false - it will show button
If it evaluates to true - it will be hiding
Sample Script below:
Note: just mention the catalog item sys_id for which you need to show
var catalogItemSysId = ''; // catalog item sys_id here
if(parent.cat_item == catalogItemSysId)
answer = false;
else
answer = true;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2021 10:01 AM
Hi Ankur,
This post is really helpful.
We want to hide the approval section of the catalog task if the state of the catalog task is either closed completed/closed incomplete. The edit option in the related list should not be visible.
----
I tried to achieve the same based on the comment you provided in the post but could not succeed.
Thanks,
Sambit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2021 05:48 AM
Did you update the Omit Edit condition script?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2021 07:26 AM
Yes We did.
Script below:
if(parent.state == 3)
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2021 07:35 AM
Can you please post this as new thread as this question is already answered?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2020 03:16 AM
HI,
Then its simple.
Just go to that omit edit condition field and add this script:
if(parent.cat_item == 'Sys id of item here - Dont remove single quotes')
answer = false;
else
answer = true;
Thanks,
Ashutosh