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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

requested_for is a field on sc_request and not on sc_task

The field you are seeing is a dot walked field from REQ

you can use this onLoad client script on your sc_task

function onLoad(){
	g_form.setDisplay('request.requested_for', false);
}

Regards
Ankur

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

function onLoad() {
   //Type appropriate comment here, and begin script below
    if (sc_task.request_item.cat_item == '2ab8ba036fb99200b7b61abf1e3ee4eb'){
        g_form.setDisplay('request.requested_for', false);
}
else {
    g_form.setDisplay('request.requested_for', true);
}}

 

 

i want to hide for only single catalog item .not for all catalog task .i have write this code but its not working .

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

Thank you so much  Ankur .