display value of a reference field

dev_K
Tera Contributor

Hi All,

 

 

I have a reference field 'application' that fetches a list of app from a table by their name. Eg. EX1234 : AppName1. 

I have another field that would be read only that should copy the prefix of this value so in this case 'EX123" but I am unable to do so because when I use onChange script and use getDisplayValue() to copy it to  the second field I get the sysID.

 

How i can handle this? I should be able to retrieve 'name' property of this record of the given sysId.

 

1 REPLY 1

Gangadhar Ravi
Giga Sage
Giga Sage

@dev_K You can try callback or GlideAjax. Please this blog post 

 

https://blog.snowycode.com/post/how-to-dot-walk-inside-of-a-client-script-in-servicenow

Please mark my answer correct and helpful if this works for you.