- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 09:49 PM
Hi Everyone,
I am trying to write an OnChange client script that will update the Short Description on a New Case Record with values derived from the form.
So far I have the following:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var LOB = g_form.getValue('u_lob');
if (LOB == 'DATA' || 'VOICE') {
var myServiceID = g_form.getValue('u_install_base_item');
var myCategory = g_form.getValue('u_category');
var myLocation = g_form.getValue('location');
g_form.setValue('short_description', myServiceID + ' | ' + myCategory + ' | ' + myLocation);
}
}
It works...sort of! at the moment all the values being pulled are the sys_id of the variable, and then obviously these end up in the Short Description field.
How do I set the variables to get the actual displayed value? I have tried 'getDisplayValue()' but this isn't working as it just brings the Case Number into each variable.
Thanks in advance for your support!
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 09:54 PM
Use below
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var LOB = g_form.getValue('u_lob');
if (LOB == 'DATA' || LOB == 'VOICE') {
var myServiceID = g_form.getDisplayBox('u_install_base_item').value;
var myCategory = g_form.getDisplayBox('u_category').value;
var myLocation = g_form.getDisplayBox('location').value;
g_form.setValue('short_description', myServiceID + ' | ' + myCategory + ' | ' + myLocation);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 09:54 PM
Use below
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var LOB = g_form.getValue('u_lob');
if (LOB == 'DATA' || LOB == 'VOICE') {
var myServiceID = g_form.getDisplayBox('u_install_base_item').value;
var myCategory = g_form.getDisplayBox('u_category').value;
var myLocation = g_form.getDisplayBox('location').value;
g_form.setValue('short_description', myServiceID + ' | ' + myCategory + ' | ' + myLocation);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 10:40 PM
I am glad my response was helpful. If your issue is resolved you can close this thread by marking my response as correct. So that other users having similar query may be benefitted.
Thanks and Regards,
Chandra Bose
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 10:41 PM
Thank you suvro...this has worked perfectly! I was trying to use getDisplayBox() but did not have the '.value' at the end 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 10:00 PM
Hello
These three fields are of which type ? are these referring to any other tables?