getAttachmentsForCurrentRecord
Returns a list of all the attachments of the current record. The list is ordereb by id desc. so the newest documents will be the first you will find while iterating over the array.
console.log(brixxApi.getAttachmentsForCurrentRecord());
let allAttachmentsForThisRecord = brixxApi.getAttachmentsForCurrentRecord();
let invoices = allAttachmentsForThisRecord.filter(singleAttachment => {return singleAttachment.documentTypeId == 2}); //We assume, that there is just one invoice
let attachmentBlob = brixxApi.getAttachmentById(invoices[0].id);
brixxApi.printBlob(attachmentBlob)
Last modified 1yr ago