- 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 12:16 PM
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:31 AM
why not show those fields as dot walked fields on the form just below the caller field?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:40 AM
I have to specifically use script include and client script, I think I tried this way first but it wasn't reading the information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2024 06:32 AM
I would still recommend showing those as dot walked fields.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2024 06:36 AM
I agree. It is preferred. It's strange that the dot-walk is not working and the OP is forced to use GlideAjax.