Need to hide "Edit" button from Approval Related List

micky09
Tera Contributor

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?

find_real_file.png

1 ACCEPTED SOLUTION

@micky09 

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;

find_real_file.png

find_real_file.png

Regards
Ankur

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

View solution in original post

11 REPLIES 11

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.

find_real_file.png

 

 

----

find_real_file.png

 

 

I tried to achieve the same based on the comment you provided in the post but could not succeed.

 

Thanks,

Sambit

 

 

Did you update the Omit Edit condition script?

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

Yes We did.

Script below:

answer = false;
if(parent.state == 3)
{
answer = true;
}
 
Just to test we have put one state condition as closed complete but that did not work
 
Suggest
 
Thanks,
Sambit
 

@sam352120 

Can you please post this as new thread as this question is already answered?

Regards
Ankur

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

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