- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 09:03 AM
Hello guys,
I am trying to compare the values "Opened By" and "Resolved By" via a Client Script. I've tried both of the below code snippets, however they don't seem to work as expected.
var openby = g_form.getReference('opened_by');
var resolveby = g_form.getReference('resolved_by');
if(resolveby == openby)
{
g_form.setReadonly('u_firstcallresolution',true);
g_form.setValue('u_firstcallresolution',true);
}
var openby = g_form.getValue('opened_by');
var resolveby = g_form.getValue('resolved_by');
if(resolveby == openby)
{
g_form.setReadonly('u_firstcallresolution',true);
g_form.setValue('u_firstcallresolution',true);
}
Please help!!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 09:06 AM
You do have a typo in your second one, it should work. Try:
var openby = g_form.getValue('opened_by');
var resolveby = g_form.getValue('resolved_by');
if(resolveby == openby)
{
g_form.setReadOnly('u_firstcallresolution',true);
g_form.setValue('u_firstcallresolution',true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 09:30 AM
Hey Elijah,
Can you tell me where the typo is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 09:37 AM
Did you try the code I posted?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 09:09 AM
Hey JD,
Try getting values like this: g_form.getDisplayBox('fieldname').value
If I was able to resolve your query then please mark my answer Helpful and Correct.
Thanks and Regards:
Utpal Dutta