Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change order of fields on form

maryc
Tera Contributor

Hi,

I have a choice fields with 3 values and in total there are 6 fields on a form.

Based on the selection of a choice field, I want the fields on the form to rearrange itself( some fields have to show and others should not be visible) .

I am using setDisplay() method on g_form, but its leaving out some white spaces in between the fields.

Is there a way to rearrange the fields so that there is no white space between the fields?

Thanks

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hey Mary,



This behavior is generally seen when you use setVisible to display/hide the field. if thats the case then you have to replace setVisible with setDisplay in all your scripts.


Also as a best practice try to use UI policy wherever possible.


http://wiki.servicenow.com/index.php?title=Creating_a_UI_Policy



I hope this helps


View solution in original post

6 REPLIES 6

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hey Mary,



This behavior is generally seen when you use setVisible to display/hide the field. if thats the case then you have to replace setVisible with setDisplay in all your scripts.


Also as a best practice try to use UI policy wherever possible.


http://wiki.servicenow.com/index.php?title=Creating_a_UI_Policy



I hope this helps


Thank you Pradeep and Srinivas. It worked