Attachment variable on record producer not getting added as attachment on HR Case created

Simran321
Tera Expert

Hi there,

 

I have added the script on record producer to add the attachment variable to the attachment that is on top of the HR case. The script is below. Can someone please see what is wrong with the script. When I attach document to performance_doumentation variable It is not getting attached as attachment

 

 

var gr = new GlideRecord('sys_attachment');
if(gr.get(producer.performance_documentation)){ //attachment field name
gr.table_name='sn_hr_core_case_relations'; //copy to table name
gr.table_sys_id=current.sys_id;//copy to record sys_id
gr.insert();
}

 

Simran321_0-1687890304723.png

 

4 REPLIES 4

Radhika1
Tera Contributor

Hi ,

Have you received any solution to this? Curious to know as I face the same issue.

Thanks

var gr = new GlideRecord('sys_attachment');
if(gr.get(producer.performance)){ //attachment field name
gr.table_name='sn_hr_core_case_relations'; //copy to table name
gr.table_sys_id=current.sys_id;//copy to record sys_id
gr.update();
}

Posted the script below.

Radhika1
Tera Contributor

@Simran321 Thank You for the reply.

 

I tried this but it did not work as I want to add an attachment as a public user.