RE: Custom Print Button in Inventory Transfer

Hello

I need some guidance in setting up a custom print button in the inventory transfer form, I see the form has the printing field but the form itself doesn’t have the print button.

Any help would be appreciated.

jomtos Rookie Asked on May 12, 2022 in SuiteScript.
Add Comment
11 Answers

Hi,

To do the actual printing you’ll need to use that client script function to call a Suitelet and in the Suitelet, do something like this:

let renderer = render.create();
renderer.setTemplateById({ id:123 });
...
scriptContext.response.addHeader({
    name: 'Content-Type:',
    value: 'application/pdf'
});
scriptContext.response.addHeader({
    name: 'Content-Disposition',
    value: 'inline; filename=”Test.pdf"'
});
scriptContext.response.writeFile(renderer.renderAsPdf());
Intermediate Answered on May 17, 2022.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.