Check if record has attachments

 see developer site

e.g. from approval record:

var sTable = current.document_id.getReferenceTable(); if (sTable == 'sc_req_item') { //--can be extended to other tables also var attachment = new GlideSysAttachment(); var agr = attachment.getAttachments(sTable, current.document_id); var sAttachments=''; while ( { sAttachments+='<br/>'; sAttachments+=" - "; sAttachments+=agr.getValue('file_name'); sAttachments+='; '; } if (sAttachments!=''){ gs.addInfoMessage(current.document_id.number + ' has the following attachments: ' + sAttachments); } }


Popular posts from this blog

GlideRecord setValue

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy