Anybody has/have idea how to writeFile and redirec...
# suitescript
c
Anybody has/have idea how to writeFile and redirect Suitelet after? I have a suitelet with Print Button to download the PDF file using writeFile. After downloading I want to redirect the Suitelet to it's Get Method.
b
use setTimeout to redirect the user after a certain amount of time
Copy code
// there are more advanced ways to do the download using anchor elements
window.location = myDownloadUrl;
setTimeout(function() {
  window.location = myRedirectUrl;
}, millisecondsToWait);
c
Yay! Thank you.