setVisible works, but setDisplay doesn't

petercawdron
Kilo Guru

I'm looking to show/hide form content based on changes on a form (including show/hide of related lists) and would like to use setDisplay (because it reclaims white space on a form), but only setVisible seems to work (which leaves white space), setDisplay fails.

g_form.setVisible('short_description', false); //works

g_form.setDisplay('short_description', false); //doesn't work

Any ideas?

1 ACCEPTED SOLUTION

petercawdron
Kilo Guru

Thanks for all the suggestions.... I've gone with a global UI policy. I had hoped to be able to do this from within an application scope, but it simply wasn't possible.


View solution in original post

14 REPLIES 14

I think you are setting the display of field to false from a different application scope


Yes... it's strange how the setVisible works from a different application scope, but not the setDisplay.



Is there any way to override this behavior?


Peter,



  Try changing your application access settings


Go thru this link. Allow access from all the application scopes


Application Access Settings - ServiceNow Wiki


rakesh90
Kilo Contributor

You can take the id of short description and document.getElementById("I'd").display:None;



it may works for your code.