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

Namrata Khabale
Giga Guru

Hey micky09,

In the list control give omit edit conition:

Omit edit condition

Have look on Below threads;

https://community.servicenow.com/community?id=community_question&sys_id=0cf247a1dbd8dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=1a4fcbe1dbdcdbc01dcaf3231f96...

 

Mark Correct an Helpful if it helps!!!

 

Best Regards,

Namrata.

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

Right click on that list and then edit list control

find_real_file.png

 

There you see omit edit condition and then you need to type the code in there to hide it.

Can you tell me which table you want to do this? Catalog task or RITM.

 

Thanks,
Ashutosh

Thank you for the reply I need to achieve this on RITM table

@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