- 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:47 AM
So we good now? you can take it form here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:51 AM
Still not sure why the data is not showing, as there message is being shown in a blue info box rather than the red error message box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:54 AM
Add logs and alerts to see how it is being processed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:56 AM
Will do, thanks
- 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