Copy a reference field value from one table to reference field in another table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2023 11:08 AM
I have a reference field called Requested for in my Accounting table and a reference field called Caller in Incident.
I am using a ui action script to copy values of fields from the Accounting table to Incident. The field that did not copy over was the Requested for field. Both of these reference fields are using the sys_user table. How do I copy the reference field value from Accounting table to reference field value within Incident table so the user that receives this Incident table doesn't have to go add a user after the ticket has been transferred?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 04:01 PM
Hi Pat,
Can you pls validate if Onclick value has your function name and "Client" checkbox is checked.
Use gs.addInfoMessage to see caller_id on the form in order to debug your script.
Regards,
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 04:06 PM - edited 03-06-2023 04:18 PM
Hello Rajeevsaraf,
Yes I have Onclick has my function name and Client checkbox is checked as well. How can I use that gs.addinfomessage for debugging?
The script works. I can transfer a ticket. However, the caller_id field is not populated from my requested for field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 04:38 PM
gs.addInfoMessage("caller_id" +caller_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 06:44 AM - edited 03-07-2023 06:45 AM
This did not work. Nothing is displayed on the screen. Anything else to try?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 07:22 AM - edited 03-07-2023 07:38 AM
Hi @Pat Surtan , Have a look this post. How to copy incident using UI action
And use current.getValue();
var inci = new GlideRecord('incident');
inci.initialize();
inci.short_description = current.getValue('short_description');
inci.caller_id = current.request.requested_for.toString();
inci.insert();
action.setRedirectURL(inci);
Thank you