- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2015 10:40 AM
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')
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2015 10:09 AM
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');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2015 08:46 AM
Why don't you use getValue instead?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2018 04:54 AM
Thats what she's testing and trying to figure out.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2015 10:09 AM
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');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2015 10:15 AM
What's the diff between getValue and getDisplayBox?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2015 10:28 AM
Hi rfedoruk
getValue will return sys_id for reference fields where as getDisplayBox will give the display value.
Please let me know if you have any questions.