setDisplay() function is not working

Naveen Kumar
Tera Contributor

in a catalog client script , 

I am able to hide a filed using g_form.setVisble('requested_by',false);

But I want to use  g_form.setDisplay('requested_by',false); so that the space will be used for other field.

15 REPLIES 15

Vamsi Sreenivas
Tera Guru

Hi Bharath Kumar,

Is the requested_by field is set to Mandatory?  Please refer note from ServiceNow below:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0717854

 

Did you tried debug using watch feature? which tells you which script/policy is trying make the field mandatory/visible/read-only.

 

Please mark my answer as HELPFUL / CORRECT if this help resolve your issue.

Regards,

Vamsi S

 

hi

its not mandatory.

My question is 

I am able to hide the field using setVisible() but I am not able to using setDisplay() function,

I need to know why.

Okay I missed you said catalog client script so we cannot use watch feature to debug.

I hope you have set UI Type to all in catalog client script. I understand the same script is working for setVisible() but not for setDisplay(), ServiceNow mentioned about the similar earlier but the link within the KB article is not working for me. Give it a try if that works for you.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0610336

 

here,

it is regarding the variable set.

I want to hide variable in a variable set.