- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 12:07 PM
I have created a record producer with questions for our Service Catalog. It creates an incident and the answers to the questions are displayed in the incident description. I have a question of who to contact that is a list collector so multiple users can be selected.
My question is how to display the user name in the description field. I have the following coded:
'\nWho may we contact for more information? | ' + producer.u_contact
With this code, what displays is the sys_id for the user and I need it to show the user name instead.
Can someone tell me how to get this to work?
Thanks.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 02:21 PM
Cindy V,
You can add the function where you are using the line
'\nWho may we contact for more information? | ' + sysIdToUserId(producer.u_contact)
I also see that you figured out something on your own, which is good.
Just to clarify why I suggested you to use a function like that is for below reasons
1. The below code is wrong, you will get undefined as the return value not the User ID's
producer.u_contact.getDisplay();
2. The below code is right, probably the shortest way to do it
producer.getDisplayValue('u_contact');
3. The code in the above step will spit out the Display Value of the Sys_User table[which may not be the UserID all the time]. So you need a function that will return all the UserIDs explicitly.
-Please mark my answer as helpful/correct if applicable. Or else please dont 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2018 08:29 PM
Yup, typo. Should have been "getDisplayValue()". 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 02:21 PM
Cindy V,
You can add the function where you are using the line
'\nWho may we contact for more information? | ' + sysIdToUserId(producer.u_contact)
I also see that you figured out something on your own, which is good.
Just to clarify why I suggested you to use a function like that is for below reasons
1. The below code is wrong, you will get undefined as the return value not the User ID's
producer.u_contact.getDisplay();
2. The below code is right, probably the shortest way to do it
producer.getDisplayValue('u_contact');
3. The code in the above step will spit out the Display Value of the Sys_User table[which may not be the UserID all the time]. So you need a function that will return all the UserIDs explicitly.
-Please mark my answer as helpful/correct if applicable. Or else please dont 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 12:58 PM
Never mind, I figured out that the function is added to the script of the record producer.
THANK YOU VERY MUCH FOR THIS INFORMATION!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2018 07:46 AM
Cindy V,