- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 08:21 PM
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 .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 01:35 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 09:30 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 01:23 AM
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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 01:35 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 01:48 AM
Thank you so much Ankur .