whats the best solution for saving a file to the c...
# suitescript
g
whats the best solution for saving a file to the cabinet from a client script?
s
Ping a suitelet or trigger a scheduled job with the client script to do the file work would be my first thought
g
and i can just pass over such large data?
(file contents are PDF)
s
Well you cant have a PDF in the client since you cant use the N/file module, so you need to pass whatever params you need over to suitelet or a scheduled script
g
what are pros/cons of the 2 or doesnt matter
s
Triggering scheduled job would generally have less impact on the user bc they are not waiting for a response when pinging; a suitelet would need to finish before user can do anything. Depends how fast the implementation is to know which is "better"
g
so if i need to alert the user when complete then I would go with a suitelet
s
Depends what you mean by alert, you could email them with the scheduled job if its going to take a while. If it isnt going to take a while then you can send a good/bad response from the suitelet and use that to alert the user... just kinda depends what you want to do
g
ok thanks, ye, I don't really want them continuing with the quoting/booking etc shipments until these docs are saved so i guess suitelet it is
if it takes too long ill have to re-eval
s
If you already have the information, then creating the PDF should take like no time. Data retrieval would be the most time consuming part generally
g
ye, i do and i need the ID to save it to the communication tab of my transaction
so i guess Suitelet it is 🙂
Thanks!