Hi there, please help why below code is not workin...
# suitescript
v
Hi there, please help why below code is not working to print invoice in customer’s locale in suitelet. Advance PDF/HTML template is used. I’m able to do/print in “Print in Customer’s Locale” through UI for the same invoice.
Copy code
var file = nlapiPrintRecord('TRANSACTION', invId, 'PDF', null, true);
response.setContentType('PDF', 'Invoice.pdf', 'INLINE');
response.write(file.getValue());
b
you will probably have a better chance using renderPDF
your contents for a pdf file are in base64, which your browser wont understand as a pdf file
v
Thanks for the reply. It is printing is English (Default company language), but not in Customer’s language even when I’m passing the last parameter incustlocale=true
And through the UI menu option it is printing correctly in customer’s locale language in the same browser
b
there is no 5th parameter
👍 1
v
Thanks for pointing this out. Finally Code below worked:
Copy code
var file = nlapiPrintRecord('TRANSACTION', invId, 'PDF', {incustlocale:true});
There use to be 5 parameter earlier like:
Copy code
nlapiPrintRecord(type, id, mode, properties, incustlocale);