Copy attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2025 12:26 PM
Hello All ,
In a RITM , i have a field where i attached a file (XLS) ...
Could you please show me how i can copy this file to another table ?
I have tried this , but the file is attached in the activity , not in the attachment doc .
var attachmentGR = new GlideRecord('sys_attachment');
attachmentGR.addQuery('table_sys_id', ritmSysId);
attachmentGR.query();
if (attachmentGR.next()) {
var sa = new GlideSysAttachment();
sa.copy('sys_attachment', ritmSysId, sys_class_name , ciLDZ );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2025 03:19 AM
If your source attachment is in RITM table then your source table should be sc_req_item instead of sys_attachment table.
var sa = GlideSysAttachment()
sa.copy(String sourceTable, String sourceID, String targetTable, String targetID)
Please refer this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2025 04:09 AM
Your cord should be :
var sa = GlideSysAttachment()
sa.copy('sc_req_item', sys_id of RITM, String targetTable, sys_id of target record)
I hope this help. Please mark it helpful/correct if it resolve your query.
Regards,
Amitra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2025 04:16 AM