- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:07 AM
Trying to create a script include and a client script to show the "caller" info (email and phone number) as a field message under caller, that changes dynamically when the "caller is changed in an incident.
I have tried about 15 different script includes and client scripts, here are the latest that I have done
SCRIPT INCLUDE:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 10:17 AM - edited 01-05-2024 10:19 AM
Taking a quick stab at this.
Following the recommended change, I just noticed the following lines
getCallerInformation: function(callerID) {
var caller = new GlideRecord('sys_user');
if (caller.get(callerID)) {
There is no parameter to pass so...
getCallerInformation: function() {
var callerID = this.getParameter('sysparm_user_id');
var caller = new GlideRecord('sys_user');
if (caller.get(callerID)) {
EDIT: Just wanted to add, that from a programming practice, I would recommend setting the GlideRecord variable to something a lot clearer, so that you know the datatype of the variable, eg. var caller --> var grCaller
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:27 AM
Don't think you have client callable checked don your script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:39 AM
I have the scope globally and I have the client callable field ticked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:42 AM
The first 2 lines of script include should be as below if client callable is true, you need to correct it
var CallerInfoScriptInclude = Class.create();
CallerInfoScriptInclude .prototype = Object.extendsObject(AbstractAjaxProcessor, {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:46 AM
This actually did help! But I am now getting "Error retrieving caller information." but it is in the right place!