1
votes

As per title, I am creating a scheduled script to import a CSV file on an hourly basis. However, I do not find any methods that I can use to grab a csv file from an external source. For eg http://samplecsvs.s3.amazonaws.com/SalesJan2009.csv

nlapiLoadFile seems to only take in files within the file cabinet.

Any ideas?

1

1 Answers

3
votes

You can use nlapiRequestURL to get the file from external system.

var myCSV_data = nlapiRequestURL('http://samplecsvs.s3.amazonaws.com/SalesJan2009.csv',null,null);
var string_data = myCSV_data.getBody(); // returns your csv data in a string format