Skip to content

Commit 6c8fec9

Browse files
authored
Copy record attachment to Email Client (#1848)
1 parent 9a8fe4f commit 6c8fec9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var CopyAttachmentToEmailClient = Class.create();
2+
3+
CopyAttachmentToEmailClient.prototype = {
4+
initialize: function() {
5+
},
6+
7+
copyAttachment: function(sourceTable, sourceSysId, targetSysId) {
8+
var attachmentRecord = new GlideRecord('sys_attachment');
9+
attachmentRecord.addQuery('table_sys_id', sourceSysId);
10+
attachmentRecord.query();
11+
if (attachmentRecord.next()){
12+
GlideSysAttachment.copy(sourceTable, sourceSysId, 'sys_email', targetSysId);
13+
}
14+
15+
}
16+
17+
type: 'CopyAttachmentToEmailClient'
18+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Use Case: If user click on Compose Email, All the attachment of corresponding record should be attach automatically to email client
2+
3+
4+
5+
`new global.CopyAttachmentToEmailClient().copyAttachment('incident', current.instance, current.sys\_id);`
6+

0 commit comments

Comments
 (0)