setDisplay() function is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 06:37 AM
in a catalog client script ,
I am able to hide a filed using g_form.setVisble('requested_by',false);
But I want to use g_form.setDisplay('requested_by',false); so that the space will be used for other field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 06:50 AM
Hi,
Make sure that other Catalog UI policies on same field are not conflicts and make it as visible.
Feel free to mark helpful and correct!
Thanks,
Sagar pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 06:52 AM
hi
My question is
I am able to hide the field using setVisible() but I am not able to using setDisplay() function,
I need to know why.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 07:10 AM
Hi,
1) Did you try to hide it through the Catalog Ui policies?
2) Also check if any fields are supposed to be mandatory and because of which the field is not showing up/hiding.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 07:56 AM
Hi,
I cannot use Ui Policy.
Because I need to use 1 condition here:
function onLoad() {
var cat = g_form.getUniqueValue();
{
if(cat == '0100714f1be85d500af31173b24bcb0f') // Customer service review catalog item
{
g_form.setDisplay('requested_by',true);
}
else
{
g_form.setVisible('requested_by',false);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 08:33 AM
Hi,
what's the variable type?
share the screenshot and complete script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader