How do we increase the display length of a Reference field?

salvadormarchan
Kilo Guru

All,

In Service Request, I have reference fields to another table and the default length is set. How can we make it longer?

Thanks,

Salvador

Ref Field Longer.png

1 ACCEPTED SOLUTION

Hi Salvador,



My answer was relating to variables. It's definitely possible, you just have to use scripting. Here's a more informative guru post about it:



http://www.servicenowguru.com/system-ui/field-styles-service-catalog-variables/


View solution in original post

6 REPLIES 6

Harish Murikina
Tera Guru

Hi Salvador,



                          Right click at Field OS and select "Personalize style". Then click new .


                      Write the script in side style is width:auto;





Harish.style.JPG


Harish.


akt_snow
Giga Expert

You won't be able to use Personalize styles as it is a Catalog Item. Style only works for form fields.


You might want try writing a Catalog client script to customize the style.



Thanks,


Avneet


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Salvador,



You can do that in an onload catalog client script with the following. It's grabbing the id of the input element and setting the width in px. This should at least get you started.



$('sys_display.' + g_form.getControl('variablename').id).style.width = '400px';


salvadormarchan
Kilo Guru

I have mistaken my question...I stand corrected...I meant variables (not form fields). I just checked with ServiceNow HI and they said it is not supported. I initiated an Enhancement Request to SNC.


Thanks all!!!!!