Hello, Im trying to create a PDF but I get this er...
# suitescript
i
Hello, Im trying to create a PDF but I get this error
missing_pdf_parameter
I’ve looked at the code and Im pretty sure Im not missing anything, any ideas?
b
i think you want writeFile instead of writePage
i
Actually no, I did have it with writeFile but in other suitelet that is fully functional and in that script I tested both writePage and writeFile and both worked 😬 the thing is what I did was just literally just copy and paste what I had, just changed the template id. Actually and this error comes a line before that I didnt add, I save the response to a variable and send that to a function that saves it to the file cabinet. The error appears when I do
var pdf = renderer.renderAsPdf()}
b
and while it might not cause an error, i dont think your data is supposed to literally be the string data1
you might also want to check that params.custscript_bit_pdf_template is the script id you expect it to be
i
Yeah, I just put that to test the data was sent correctly haha
Here is the function in other suitelet that works!
Untitled
b
you should make sure you understand how getParameters works
that should only work in your script if the parameters are company level
i
Yeah that is a function I created, and yeah I thought the issue was the id so i logged it and is in fact the id of the pdf
I think Im almost there now I just get an unexpected error haha
b
make sure your template is correct
i was able to reproduce your error from working code by settting the wrong template
i
Yeah, it was that, what i did was that I copied from the template setup in the netsuite editor, and it had a space!! so it was
custtmplĀ _bit_pour_schedule_pdf
facepalm 1
😤
Thanks a lot @battk!!!