Capture Custom Record in a Updateset

//Query for the record
var rec = new GlideRecord('sys_number');
rec.get('973c8e8a9d022000da615b13b3a22f32');
//Push the record into the current update set  
var um = new GlideUpdateManager2();
um.saveRecord(rec)

Capture Record along with attachment

//Query for the record
var rec = new GlideRecord('sys_attachment');
rec.get('973c8e8a9d022000da615b13b3a22f32');
addAttachmentToUpdateSet(rec);

function addAttachmentToUpdateSet(attachmentGR) {
   var um = new GlideUpdateManager2();
   um.saveRecord(attachmentGR);

   var attdoc = new GlideRecord('sys_attachment_doc');
   attdoc.addQuery('sys_attachment', attachmentGR.sys_id);
   attdoc.orderBy('position');
   attdoc.query();
   while(attdoc.next()){
      um.saveRecord(attdoc);
   }
}

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *