The CreatorCon Call for Content is officially open! Get started here.

Get reference field value

sigmachiuta
Kilo Guru

I am trying to compare to see if the opened by and assigned to fields are the same in a client script.   I keep getting the sysid of the fields and it doesnt seem like the comparison is correct.   HOw can I compare these two values?

var open = g_form.getReference('opened_by')

var assigned = g_form.getReference('assigned_to')

if (newValue == 3 && open == assigned)

alert('success')

1 ACCEPTED SOLUTION

Hi,



Try the below script if you just want to compare the display names.


var caler = g_form.getDisplayBox('caller_id').value;


var assig = g_form.getDisplayBox('assigned_to').value;


if(caler == assig)


{


alert('in');


}


View solution in original post

12 REPLIES 12

Just one more question.   Do you know of a machine powerful enough to extract my head from my behind?   I thought getValue got the display value of whatever was in the field.



<double checking 8 years of work>


Hi i tried g_form.getDisplayBox('state').value;

but its throwing error - 

find_real_file.png

 

 

 

 

find_real_file.png

 

Can you tell me whats the error here? 

FIKRI BENBRAHIM
Kilo Guru

Hello sigmashiuta,

   use the following: name_of_your_field.getDisplayValue(). See the following link uses a the sys_id of an incident  into a gliderecord to show its display value using getDisplayValue. Here is the link for that: Link.

   Please mark my answer correct or helpful if it helps you.

 

Kind regards

FIKRI BENBRAHIM Mohamed Jawad