- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 05:37 AM
I've been trying to use this script for a UI Action button that will pre-fill additional comments with a salutation and sign-off. The trouble is, what seems to very clearly say caller ID to me in the script keeps pasting incident Number into that space of additional comments, instead?
What am I missing?
function writeComment(){
var message = "Dear " + g_form.getDisplayValue("caller_id") + ", <insert comments here>\n\n\n" + " Best regards, " + g_user.getUserName();
g_form.setValue("comments", message);
g_form.getControl("comments").focus();
}
Yields:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 05:46 AM - edited 07-26-2024 05:47 AM
Hi @JP-ODU
Use g_form.getDisplayBox('caller_id').value; Instead of g_form.getDisplayValue("caller_id");
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 05:46 AM - edited 07-26-2024 05:47 AM
Hi @JP-ODU
Use g_form.getDisplayBox('caller_id').value; Instead of g_form.getDisplayValue("caller_id");
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP