- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 04:49 PM
Hi everyone,
Can anyone guide me to copy attachments from 'Case' to 'Incident' without any duplicates ?
I have already tried this code which is working fine but I am getting duplicates everytime a new attachment is added.
please correct me how to avoid Duplicate attachments?
updateINCAttachment: function(source, sourceRecord) {
var getIncident = new GlideRecord("sn_customerservice_case");
getIncident.addQuery('sys_id', sourceRecord); // if i have case attachement with case sys id
getIncident.query();
if (getIncident.next()) {
var IncidentsysId = getIncident.incident;
//Updating the Incident attachment with Case attachment
GlideSysAttachment.copy('sn_customerservice_case', sourceRecord, 'incident', IncidentsysId);
}
},
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 07:51 AM
Hi,
this link has solution which avoids loop
Copy Attachment from ritm to task and vice versa without looping
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2022 05:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 07:51 AM
Hi,
this link has solution which avoids loop
Copy Attachment from ritm to task and vice versa without looping
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader