function customerPdfAttachment(newRecord, cusId) {
try {
let fileId = generatePdf(newRecord);
if (checkForParameter(cusId) && checkForParameter(fileId)) {
record.attach({
record: {
type: 'file',
id: fileId
},
to: {
type: 'customer',
id: cusId
}
});
}
return fileId;
}
catch (err) {
log.error("error@customerPdfAttachment", err);
return null;
}
}