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 (agr.next()) {
sAttachments+='<br/>';
sAttachments+=" - ";
sAttachments+=agr.getValue('file_name');
sAttachments+='; ';
}
if (sAttachments!=''){
gs.addInfoMessage(current.document_id.number + ' has the following attachments: ' + sAttachments);
}
}
Comments
Post a Comment