Hi All, I want Invoice to added printing queue fr...
# suitescript
s
Hi All, I want Invoice to added printing queue from suitelet script, instead it’s opening the PDF File in new window I have to print from there , here is my code , any idea
b
s
i tried already this still opening in new window not printing directly,context.response.writeFile({file: pdfFile,isInline : true});
b
are you expecting it to automatically print?
s
Yes
b
use Window.print() from the window returned by Window.open
s
sorry , i don’t understand this, if i do window.print() i am getting error, may be did something wrong
b
you need to share more than that
you need to share the code and the error you get
in general you need to be able to read the documentation on mdn, its where javascript is documented
s
Err Msg : org.mozilla.javascript.EcmaError: ReferenceError: “window” is not defined. (/SuiteScripts/printsuitelet.js#74)
b
the window is a global variable in browsers
you would use client script (usually a button) to open your suitelet's url
and from there print it