Attachment variable on record producer not getting added as attachment on HR Case created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2023 11:25 AM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 05:17 AM
Hi ,
Have you received any solution to this? Curious to know as I face the same issue.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 09:14 AM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 09:15 AM
Posted the script below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 09:19 AM
@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.