- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 02:55 PM
When I need to communicate with an end user and send them an attachment from within a record, I use the Email icon on the toolbar. This opens up a standard "New Email" window. I fill in the To, From, Subject and body. I then add an attachment and then click send. However, after the email is sent, the record does not get updated with the attachment. How do I do this without having to manually add the attachment before or after I send the email?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 09:31 PM
Hi Charlie,
I would create a oninsert Business Rule on sys_email table and look for emails that going out with the header something like this "X-ServiceNow-Source: EmailClient"
and copy attachments
Name: Copy Attachments from Record to Record
Type:
Table:
Description:
Parameters:
Script:
GlideSysAttachment.copy('sourcetable', 'sys_id', 'destinationtable', 'sys_id');
Note: GlideSysAttachment.copy copies all attachments; it cannot select specific attachments. |
Thanks
Srini
Mark this response as helpful/correct if does so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 09:31 PM
Hi Charlie,
I would create a oninsert Business Rule on sys_email table and look for emails that going out with the header something like this "X-ServiceNow-Source: EmailClient"
and copy attachments
Name: Copy Attachments from Record to Record
Type:
Table:
Description:
Parameters:
Script:
GlideSysAttachment.copy('sourcetable', 'sys_id', 'destinationtable', 'sys_id');
Note: GlideSysAttachment.copy copies all attachments; it cannot select specific attachments. |
Thanks
Srini
Mark this response as helpful/correct if does so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2016 10:44 AM
Do you have an example I could follow? I'm still new to the coding thing and I'm the only developer/sys admin for my whole company. We have a table called Facilities Request (facilities_request) and we use the Requested Item table (sc_req_item) also. I'm needing any emails sent out or any incoming emails with attachments to be added to the existing record on the facilities request or requested item table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 09:33 PM
Hi Charlie,
Srinvas is right. You have to use GlideSysAttachment to copy the record to the target "incident" table. Please refer the sample example and adjust your code accordingly.
http://wiki.servicenow.com/index.php?title=Copy_Attachments_from_Record_to_Record