- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:05 PM
Hello Snow community,
I'm trying to hide an HTML field from the service catalog
I used this method and it works well with every kind of field, expect for the html one,
g_form.setVisible('my_field_name', false);
Is it a real bug or i missed someting ?
Because it seems to hide the block, but not the content in it.
Screens below :
Supposed to be hide :
Supposed to show the block
You can noticed the title item is displayed
Regards,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:14 PM
Romain,
Try to use setDisplay() instead of setVisisble
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:28 PM
Perfect !
I never used setDisplay() !
So, do you know, what is the main differences between setVisible() and setDisplay() ?
The wiki just said :
For setDisplay, If the field is hidden, the space is used to display other items. and for setVisible() If the field is hidden, the space is left blank.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:34 PM
Hi Romain,
As mentioned on wiki, if you use "setVisible()" then the space will be blank for that specific field hidden on the form and the form looks clumsy.
Please let me know if you have any questions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:25 PM
Hi Roman,
Best Practice: Use UI Policy rather than this method whenever possible.
GlideForm (g form) - ServiceNow Wiki