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!
Beginner Asked on March 15, 2024 in SuiteScript.
Add Comment
1 Answer(s)

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);
Rookie Answered on April 22, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   SuiteMigration   Become a Sponsor