setDisplay not working in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 05:15 AM
Hi,
I'm trying to hide the created and created by fields on newly creating record in custom scope table. It is not working.But when i applied setVisible, those fields are hidden but space is creating on the form. Is this scope issue ?
g_form.setDisplay('sys_created_on', false);
g_form.setDisplay('sys_created_by', false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 01:50 AM
@Ankur Bawiskar I have attached the screenshot please check and propose me the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 05:44 AM
If the use case is simply for those two fields to be hidden only when the form is new, you could try using a UI Policy.
Since the use case is on a new creation of the record, the condition would be when the "created" and "created by" fields are empty; no script needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 06:48 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 05:52 AM
Hi,
g_form.setDisplay function always leaves the blank space in the standard UI view. it will work fine in Service Portal view. You can use UI policy to fix this issue
Palani