
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 08:26 AM
Hi,
We have a catalog item that contains a variable set called Delivery Options. This set contains a number of variables, one of which is delivery_address for home delivery, which is made visible by a ui policy if another choice variable= home. We would like to hide this variable on the RITM for everyone, and on the sc_task for everyone other than members of the fulfilling group - this bit is working fine. To achieve this we have an on load client script which applies on the RITM and task, UI Type = All with the script below, but the variable is still showing on the RITM. We have tried the client script within the set, on the item, applying to the variable set and applying to the item, but in all cases the RITM still shows the address. We also use this script in another item, where it does hide the address on the RITM, but in this case the address is a stand alone variable. Can anyone suggest why this doesnt work for variable sets?
function onLoad() {
var tableName = g_form.getTableName();
if (tableName == 'sc_req_item') {
g_form.setDisplay('delivery_address', false);
}
if (tableName == 'sc_task') {
var ga = new GlideAjax('BespokePortalUtils');
ga.addParam('sysparm_name', 'isUserInGroup');
ga.addParam('sysparm_group', g_form.getValue('assignment_group'));
ga.getXMLAnswer(ajaxResponse);
}
}
function ajaxResponse(response) {
var answer = response;
if (answer == 'false') {
g_form.setDisplay('delivery_address', false);
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 08:35 AM
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 08:35 AM
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 12:49 AM
Thanks Harish, that works, although still a little confusing why setDisplay works on task but not on RITM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 01:38 AM
for variables you have to use
g_form.setDisplay('variables.variablename',false);
Harish