- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 05:14 AM
A pop up window should appear with a message when the Channel changes. I need to display the caller name. This code works but it does not display the caller name. This is a client script and the agent is on Service operational workspace.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var previousChannelType = oldValue;
var callerID = g_form.getValue('caller_id');
var caller = "";
//Get the name of the caller
if (callerID) {
var userRecord = new GlideRecord('sys_user');
if (userRecord.get(callerID)) {
var firstName = userRecord.getValue('first_name');
var lastName = userRecord.getValue('last_name');
caller = firstName + " " + lastName;
}
}
// Check if the selected channel type is 'alert / notification'
if (previousChannelType != '' && previousChannelType != 'alarm_notification' ) {
var msg = "Please note : This incident is currently defined as " + previousChannelType + " channel type and has been changed to alert/notification channel type. The caller " + caller + " has been removed from the incident.";
g_form.addInfoMessage("previousChannelType: " + previousChannelType);
g_modal.confirm(getMessage("Alert"), msg, function (confirmed) {
if (confirmed) {
g_form.save();
}
});
return false;
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 05:24 AM
Hi @vidhya_mouli ,
Its not recommended to use GlideRecord in Client Script kindly call a script include using GlideAjax to retrieve caller id name .
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 05:24 AM
Hi @vidhya_mouli ,
Its not recommended to use GlideRecord in Client Script kindly call a script include using GlideAjax to retrieve caller id name .
Thanks,
Danish