The CreatorCon Call for Content is officially open! Get started here.

How can i hide Requested for field in catalog task in maintain role permission catalog item

Anoop15
Tera Contributor

i have hide requested for variable in request item form by using ui catalog policy .but not able to hide in catalog task .i have try to do this by using ui policy and workflow variable set but its not work .find_real_file.pngfind_real_file.png

1 ACCEPTED SOLUTION

Hi,

update as this

function onLoad() {
	//Type appropriate comment here, and begin script below

	var itemSysId = g_form.getReference('request_item').cat_item;
	if (itemSysId == '2ab8ba036fb99200b7b61abf1e3ee4eb')
		g_form.setDisplay('request.requested_for', false);
	
}

Regards
Ankur

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

View solution in original post

6 REPLIES 6

Glad to help.

Please mark response helpful as well.

Regards
Ankur

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

Hi @Ankur Bawiskar ,

I have almost the same requirement. I have to hide approval and contact type field on the Requested Item table if catalog item is ABC.

I tried the above OnLoad script on requested item but it is giving error "cat_item is not defined".

 

function onLoad() {

    if (g_form.getValue(cat_item == '13cee83e9386f55034dbbb2c5cba108f')){
        g_form.setDisplay('approval', false);
        g_form.setDisplay('contact_type', false);
}
}

Please help.

Sam