Grey out "No longer Required" option from the Approval drop down "Action on selected rows"

Community Alums
Not applicable

Hi,

I have a requirement to grey out/hide "No longer Required" option from the Approval drop down from "Action on selected rows" and this should be hidden only to tickets generated from a particular catalog item. How can I achieve this? Any suggestions would be greatly appreciated. Here is the screenshot of the requirement. I have to hide "No longer Required" option which is highlighted in yellow for tickets generated from a particular catalog item. Please guide me.

 

saran20_0-1700127807733.png

 

Thanks,

Saran.

 

15 REPLIES 15

Tai Vu
Kilo Patron
Kilo Patron

Hi @Community Alums 

Let's set the condition in your UI Action to achieve it.

1. Open the UI Action. You should be able to find the UI Action with the below URL.

URL: https://<instance_name>/sys_ui_action_list.do?sysparm_query=table%3Dsysapproval_approver%5Elist_action%3Dtrue%5EnameLIKENo%20Longer%20Required&sysparm_first_row=1&sysparm_view=&sysparm_choice_query_raw=&sysparm_list_header_search=true

 

2. Add the condition below to make it available for specific catalog item. 

 

current.sysapproval.ref_sc_req_item.cat_item == '<your_catalog_item_sys_id>'; //replace your catalog item sys_id

 

 

You can create a system property to store the catalog item sys_id to avoid hard-coding.

 

Cheers,

Tai Vu

Community Alums
Not applicable

Hi @Tai Vu 

I have used the above condition in the UI action and the change is applied to all tickets from all catalog items but I want to hide this UI action only for a specific catalog item. Could you please help me out? Here is the screenshot for your reference.

saran20_0-1701068347929.png

 

Thanks,

Saran.

 

Hi @Community Alums 

If you'd like to hide the UI Action, the condition should be not equal. So let's change it.

From

current.sysapproval.ref_sc_req_item.cat_item == '2831b98ea11a5180cdd7ea38bc3b7e90';

To

current.sysapproval.ref_sc_req_item.cat_item != '2831b98ea11a5180cdd7ea38bc3b7e90';

 

Cheers,

Tai Vu

Community Alums
Not applicable

Hi @Tai Vu 

If I use the not equal to in the below condition, the 'No longer required' button is still visible for all catalog items.

ApprovalListChoiceCondition() && current.sysapproval.ref_sc_req_item.cat_item != '2831b98ea11a5180cdd7ea38bc3b7e90' 

 

If I use the below equal to in below condition, 'No longer required' button is not visible to all catalog items.

ApprovalListChoiceCondition() && current.sysapproval.ref_sc_req_item.cat_item == '2831b98ea11a5180cdd7ea38bc3b7e90' 

 

It is weird! It is working the opposite and moreover the change is applied to all catalog items.

But my requirement is to hide for a specific catalog item. Any suggestions please.

Here is the screenshot for your reference.

saran20_0-1701151302898.png

Thanks,

Saran.

 

Community Alums
Not applicable

Hi @Tai Vu 

Any suggestion on the above query please?

 

Thanks,

Saran.