Skip to content

Instantly share code, notes, and snippets.

View kunalkhatri's full-sized avatar

Kunal Khatri kunalkhatri

View GitHub Profile
@kunalkhatri
kunalkhatri / copy_specific_attachment.js
Created March 20, 2025 06:55
ServiceNow : Copy specific Attachment from one record to another
var CopyAtttachmentUtils = Class.create();
CopyAtttachmentUtils.prototype = {
initialize: function() {
},
copySpecificAttachment : function (donorAttachmentID, recipientTable, recipientID) {
var grNewAttachment;
var attDataRecord;
var newDocRecord;
var grAttachment = new GlideRecord('sys_attachment');
if (grAttachment.get(donorAttachmentID)) {