how to display the value of a reference field using business rule scrpits

Abhinab Achary1
Tera Guru

Hi All,

I am having issue with displaying the reference field value using business rule advanced scripts..

When normal field is taken its displaying OK but when reference fields is taken into consideration its shows SYS_ID

whereas contact is shown as it is .

i tried with getvalue and all dint help attched is the o/p and the code written

Tried both line 29 and 30 not helping.

Please can you guide.

Thanks

Abhinabsample1.JPGsample 2.JPG

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Abhinab,



Append getDisplayValue() to the reference fields i.e glideinc.caller_id.getDisplayValue()


GlideRecord - ServiceNow Wiki


View solution in original post

6 REPLIES 6

Thanks Abhinab for the update.


getDisplayBox('caller_id').value will work at client side only.


getvalue gets the value of a field and getdisplayvalue returns the value of the field (marked as 'Display' in its dictionary) ,as reference field returns sys_id ...we use getdisplayvalue to get the actual desired value of the column/field.



check 5.5 of below:-



http://wiki.servicenow.com/index.php?title=Coding_Best_Practices#Use_getDisplayValue.28.29_Effective...




Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


Thanks,
Deepa