setDisplay not working in client script

Rakesh50
Mega Sage

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);

 

 

8 REPLIES 8

@Ankur Bawiskar I have attached the screenshot please check and propose me the solution

ChrisBurks
Mega Sage

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.

@ChrisBurks  Tried your suggestion but ui action was not inserting

Rakesh50_2-1695736095806.png

 

palanikumar
Giga Sage

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

Thank you,
Palani