Client Script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 11:59 PM
I'm new to ServiceNow
1.Write a code to print Caller : Manager , Location , Department ,Email with "GetReference".
2.Write a code to print Caller : Manager , Location , Department ,Email "without GetReference".
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 01:02 AM
Hi @Ram012 ,
Recommend to use Glide Ajax but , As your requesting via getReference method:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.getReference('caller_id', function(caller) {
if (caller) {
var infoMessage = 'Caller: ' + caller.name + '\n' +
'Manager: ' + caller.manager.getDisplayValue() + '\n' +
'Location: ' + caller.location.getDisplayValue() + '\n' +
'Department: ' + caller.department.getDisplayValue() + '\n' +
'Email: ' + caller.email;
g_form.addInfoMessage(infoMessage);
} else {
g_form.addErrorMessage('Caller information could not be retrieved.');
}
});
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....