- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 08:28 AM
I am trying to hide a field through onLoad. But setDisplay functionality is not working
Solved! Go to Solution.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 08:32 AM
If you want to hide a filed you should be using g_form.setVisible(name, visibility).
g_form.setVisible('u_ct_app', false);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 08:34 AM
Hi Srini,
Few quick options.
1. Change the UI Type to Both
2. Use below snippet
var ctvalueis=g_form.getValue('u_ct');
alert('CT Value is '+ctvalueis);
if(ctvalue!='Config')
{
alert('Successfully validated the if condition');
g_form.setDisplayValue('u_ct_app',false);
}
Comment the alert conditions if all works well.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 09:44 AM
nope not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 09:54 AM
are you sure the condition which you have used that is working ?
and this kind of requirement can be easily done by Catalog UI Policy , i would suggest go through UI Policy.
now coming back to setDisplay() , it works might be you are missing something in your script. as other folks already suggested you to add alert() in your catalog client script so are you getting alert pop up ? put the alert('hey if') inside the if block