Copy a reference field value from one table to reference field in another table

Pat Surtan
Tera Expert

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?

10 REPLIES 10

 

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

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.

gs.addInfoMessage("caller_id" +caller_id); 

This did not work. Nothing is displayed on the screen. Anything else to try?

Sonu Parab
Mega Sage
Mega Sage

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