Copy attachments from email when using cart object in inbound action, set target record


it seems that you need to get the sys_id of the REQ table

GlideSysAttachment.copy('sys_email', sys_email.sys_id, 'sc_request', rc.sys_id);

set target to the REQ table

sys_email.target_table = "sc_request";
sys_email.instance = rc.sys_id;

or RITM table

if(rc != undefined){
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", rc.sys_id);

sys_email.target_table = "sc_req_item";
sys_email.instance = gr.sys_id;



Popular posts from this blog

GlideRecord setValue

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy