Hiding a variable on catalog item level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Greetings,
I have a requirement to hide a variable on catalog item (order guide really). I am trying to achieve this requirement through a UI Policy or alternatively through a Catalog UI Script. But for some reason the variable keeps on displaying on the catalog item view, I am not why and how this happening. See my configs below.
Client script configs:
UI Policy configs:
Result:
Please be advised that I am not implementing both at once, I tried both the above solutions but I am not getting the desired results.
Many thanks,
Kamva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @Kamva1
To hide the variable, use:
g_form.setDisplay('variable_name', false);
and
If the variable needs to be hidden conditionally:
function onLoad() {
if (/* condition */)
{ g_form.setDisplay('variable_name', false);
}
}
Maybe by mistake you've put setDisplay value to "true" instead of "false"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hello @Kamva1 ,
you have to hide request type variable on catalog item level correct ?
If yes then in your catalog client script you have to set display value to false in order to hide .
ex. g_form.setDisplay('request_type',false);
In catalog ui policy you have set attributes mandatory and visible as false to hide variable . Generally ui policy is used to hide field/variable based on certain conditions if you dont need that variable anymore without any condition then you can directly set it as active=false so it will get remove from form .
If this helps you then mark it as helpful and accept as solution .
Regards,
Aditya