I am applying client script for setDisplayValue on "state" field of incident form but the script is not runnign on it what can be the issue?

ajinkya10
Kilo Contributor

Please help me out regarding this I am novice so learning things.

5 REPLIES 5

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Could you describe what you're trying to accomplish here? setDisplayValue() isn't supported client side so you won't be able to use it there.



Client Side GlideRecord - ServiceNow Wiki


Anurag Tripathi
Mega Patron
Mega Patron

use g_form.setValue() on client side and glide record on server side.


-Anurag

kemmy1
Tera Guru

g_form.setValue() only brings over the sys_id value if it's a reference field.  How do you grab the display value on client side?

use getReference with call back

See the eg here

https://www.servicenowguru.com/scripting/client-scripts-scripting/gform-getreference-callback/

-Anurag