So I know it's possible to "task" a scheduled scri...
# suitescript
c
So I know it's possible to "task" a scheduled script to run on demand, but is there a way to schedule a time for a scheduled script to run with suitescript?
a
I've never done that, and don't really understand why you want to... but script deployment records are accessible from suite script, so I assume you can do exactly that. https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2022_2/script/record/scriptdeployment.html
c
We are sending CSV to a customer's SFTP server. They process the CSV every 15 minutes and save a report to the SFTP server. I'm hoping to schedule a script to retrieve that report, this was the first route that came to mind. I'm open to suggestions if a better approach comes to mind! For some reason I thought script deployments weren't able to be changed via the record module. I'll have to give that a shot. Thanks!
a
I thought the same thing with regard to script deployments and record module, I was surprised to find that in the records browser 😉 umm why not just attempt to retrieve a report every 15 minutes too?
if there's nothing to retrieve it will only take a second or 2
c
Path of least resistance, honestly. Though it shouldn't be much harder to just schedule it to check every x minutes
a
i mean its not "efficient" but if there's an issue whereby their side is delayed generated the report, and you set your pickup script to trigger at whenever you send + 15mins then you might miss it?
i guess after years of doing this, I always opt for safe and boring over clever and efficient 😄
😄 1
c
As of right now, the script pulls the most recent report from their sftp server. I was hoping to only have it run after each time a CSV was submitted, that way i get 1 report per CSV upload. Some extra logic would prevent a recurring script from retrieving the same reports, but i'm just being lazy, lol
a
lol delete the report when you retrieve it? or the usual process is to have a subfolder in the SFTP pickup folder called "processed" or something and you move it to there
not always an option depending on the SFTP server admin situation though.
i guess you can compare timestamp to current time and only pickup things that are <15mins old?
c
My assumption is I only have read/write permissions, yeah, though i haven't tested a delete.
I like the idea of checking how old the newest report is, that's a good one
a
its a little more upfront work for you, but honestly you don't want to miss a report in 6 months and no one understand why, and it was just that it was delayed 5 mins
c
Thanks for your input @Anthony OConnor I appreciate it!
👍 1