- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 09:09 AM
Hi All,
When ever a chat is live (interaction) and agent clicks on create incident the ticket an incident is created from the agent workspace and populates the fields as mapped .
But the location of the caller not not getting set when the incident is created and is left out blank.
There is a onchange script which handles this reference on the incident form
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 10:10 AM
Hi Karan,
function onChange(control, oldValue, newValue, isLoading) {
g_form.setReadOnly('location.country', true);
g_form.setReadOnly('location.u_region', true);
if ((isLoading && !g_form.isNewRecord()) || (g_form.isLiveUpdating && g_form.isLiveUpdating()))
return;
if (newValue == '' || newValue == null) {
g_form.setValue('location', '');
return;
}
if (!g_form.hasField('location'))
return;
var caller = g_form.getReference('caller_id', setLocation);
// If the incident is newly created and the caller is available, explicitly call setLocation function
if (g_form.isNewRecord() && caller)
setLocation(caller);
}
function setLocation(caller) {
if (caller)
g_form.setValue('location', caller.location);
}
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 10:10 AM
Hi Karan,
function onChange(control, oldValue, newValue, isLoading) {
g_form.setReadOnly('location.country', true);
g_form.setReadOnly('location.u_region', true);
if ((isLoading && !g_form.isNewRecord()) || (g_form.isLiveUpdating && g_form.isLiveUpdating()))
return;
if (newValue == '' || newValue == null) {
g_form.setValue('location', '');
return;
}
if (!g_form.hasField('location'))
return;
var caller = g_form.getReference('caller_id', setLocation);
// If the incident is newly created and the caller is available, explicitly call setLocation function
if (g_form.isNewRecord() && caller)
setLocation(caller);
}
function setLocation(caller) {
if (caller)
g_form.setValue('location', caller.location);
}
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar