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 Bharath Kumar,
Is the requested_by field is set to Mandatory? Please refer note from ServiceNow below:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0717854
Did you tried debug using watch feature? which tells you which script/policy is trying make the field mandatory/visible/read-only.
Please mark my answer as HELPFUL / CORRECT if this help resolve your issue.
Regards,
Vamsi S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 06:52 AM
hi
its not mandatory.
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:03 AM
Okay I missed you said catalog client script so we cannot use watch feature to debug.
I hope you have set UI Type to all in catalog client script. I understand the same script is working for setVisible() but not for setDisplay(), ServiceNow mentioned about the similar earlier but the link within the KB article is not working for me. Give it a try if that works for you.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0610336
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 08:02 AM
here,
it is regarding the variable set.
I want to hide variable in a variable set.