<@U6MCCN36F> So you'd have to have a scheduled scr...
# suitescript
s
@saraki So you'd have to have a scheduled script that runs nightly, and uses an already created csv import?
s
Yes
s
I'm surprised there isn't a way to, via netsuite, have a scheduled csv import that runs. How are you able to call the csv import? It seems that you have to have a file when you initially create it
Also didn't see a place to add a csv script id
s
@screnshaw here is an example from the help. You can find the 2.0 version. I did it long ago so I still did not explore the same in 2.0
var mappingFileId = 2; //using internal id of Saved CSV Import var primaryFile = nlapiLoadFile(73); //using the internal id of the file stored in the File Cabinet var job = nlapiCreateCSVImport(); job.setMapping(mappingFileId); job.setPrimaryFile(primaryFile); job.setOption("jobName", "job2Import"); //returns the internal id of the new job created in workqueue var jobId = nlapiSubmitCSVImport(job);
s
ah. I wish they'd forever give everything a scriptId. Because that internalid will be different on production
s
Well, just use Script parameters to make it dynamic. But yes, you still have to update the parameter when you move it to Prod 🙂
r
When you save a mapping, you can specify an import id for the mapping, I believe that can be used instead of the internal id.