Is there an automated way to know when a search ta...
# suitescript
a
Is there an automated way to know when a search task is finished exporting? Manually checking with
task.checkStatus
isn't good enough for my use case.
s
What process needs to be notified of the completion of the task?
a
I need to send the CSV out via SFTP as soon as the task finishes
s
It can't wait 15 minutes?
I wrote something like this before, and there was a M/R script which checks task status for all tasks which are not complete. it is scheduled to run every 15 minutes
I have another record which contains the status of the export.
so the M/R will grab any that aren't complete, and check on their status.
a
I'm creating these tasks in a scheduled script. So I'd need another one to check the statuses then?
s
Yes, that would do the trick.
a M/R script would allow you to schedule every 15 mins
do you have a custom record to represent the search export task?
a
Yeah I'm tracking all this with a custom record
s
cool, yes, then create the other script to check status and drop the files to SFTP when the status is complete.
so Script A initiates, and Script B completes.
b
you can probably skip the scheduling every 15 minutes by using an inbound dependency
s
OR if it's light enough, you can complete the check action in the same script
s
awesome! I haven't seen that before..
@battk do you know how it handles deployments if they're in use?
b
dont know
s
My guess: 💥
a
Oh nice I never saw that until now. Looks like exactly what I need. Thanks!