I need to hide a variable on one item in an order guide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 06:44 PM
Hi All,
Need to hide one variable in catalog item if user selects from order guide. I have created a catalog item with 4 check box variables.
1. Natural
2. Artificial
3. Add
4. Remove
If user submitting through seperate catalog item - If i check Natural check box display 'Add' & 'Remove' variable.
If user submits from order guide - always needs to hide 'Add' variable if Natual check box checks it should display only 'Remove' option.
In catalog item i have added Ui policy and working as expected, In order guide this is choose option section is also displying 'Add' check box
for hiding i have written this on load script in item, but Ui policy is working after form loading.
function onLoad() {
var isOrderGuide = g_service_catalog.isOrderGuide();
if(isOrderGuide){
g_form.setDisplay('add', false);
g_form.setDisplay('internal_user_group_ad', false);
}
}
Can any one help me to get this functionality work as expceted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 08:45 PM
Try this script
function onLoad() {
try {
if($("sysparm_guide")) {
return;
}
} catch(e) {
}
g_form.setDisplay('add’,false);// replace if variable name is incorrect
Regards,
Shyamkumar
}
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 11:05 PM
Hi @praveen47 ,
Try this code ...
var isOrderGuide = g_orderguide.name();
if(isOrderGuide == 'name_of_order_guide_here'){ //name of your order guide paste it.
g_form.setDisplay('add', false);
g_form.setDisplay('internal_user_group_ad', false);
}
or
if($("sysparm_guide")){
g_form.setDisplay('add', false);
g_form.setDisplay('internal_user_group_ad', false);
}
I hope this helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 03:41 AM
Hi @Sohail Khilji ,
Thanks for reply,
The script which is provided by is working If i display 'Add' variable directly in form. but 'Add' variable displaying only when we select natural check box. On checking of 'Natural' Variable still that is displaying.
Is there any way to override Ui poclicy action on submitting through Order guide