How to attach invoice pdf on invoice record in communication tab using suitescript 2.0?
I have customized invoice advanced pdf. now I want to attach this pdf to invoice record in the communication tab and send email to the customer when invoice record is created. Thanks In Advance!
If the pdf is already in the file cabinet, you can attach it using record.attach. The pdf will be the child and the invoice will be parent.
SuiteScript 2.x
let attributes =
{
field : fieldid || null,
role : roleid || null
};
record.attach({
record: {
type: childtype,
id: childid
},
to: {
type: parenttype,
id: parentid
},
attributes: attributes
});
SuiteScript 1.0
var attributes = {field : fieldid || null), role : roleid || null)};
nlapiAttachRecord(childtype,childid,parenttype,parentid,attributes);



