I have suitelet that on POST makes an API call to...
# suitescript
s
I have suitelet that on POST makes an API call to a 3rd party while I wait for a response I load an HTML page with spinner how do I update the page when I get a response?
Copy code
options.response.writePage(spinner)
c
Client side with promises. Maybe try an html element on the page that initially displays the spinner and when data is received back, complete the promise and display the data or whatever you need to do with it. To keep it native, i've used the netsuite message banners at the top and just display a "You'll be re-directed momentarily" banner and then when you get a response (or data is ready), you can do redirect or remove the banner or whatever you need to do.
s
I've done the same... hide body with client/show spinner, once response is received just let it do the redirect like normal
c
Otherwise, you can go w/ the dark arts and use jquery and do whatever you want in your suitelet
s
lol if i was really bored but want to keep it simple
then the HTML file would need a script tag to make an ajax request?(client side)
b
you can use libraries like jquery in the client script attached to the suitelet
you dont need to use a script tag
honestly its better since you control the jQuery version
s
currently i am only sending back pdf i would like to have it open in new page
Copy code
options.response.writeFile({
            file: labelFile,
            isInline: true,
          })