Hello, I’m trying to generate a CSV from a Saved S...
# suitescript
v
Hello, I’m trying to generate a CSV from a Saved Search via the method
task.create()
from the N/task module. Since it is asynchronous, if I try to open the file URL immediately (via script) after executing the task, I see a blank CSV file. Is there some way (like promises maybe) to know when the CSV file generation is done?
I found the method
task.checkStatus()
but it will just show me the status, right?
Also, is there a way to view these task records in NetSuite?
Found a method
SearchTask.addInboundDependency()
which can apparently be used to trigger a scheduled script once the task execution is completed. I am probably going to use this one in my solution. I hope this is the best possible way to handle such a scenario.
🙌 1