How can I upload a file to Netsuite File Cabinet automatically?
would nLapiRequestURL("Server1/database1/NDT/ftp.csv
work?
File is to be fetched from a server within company.
I need to import CSV file to the cabinet automatically once a day.
How can I upload a file to Netsuite File Cabinet automatically?
would nLapiRequestURL("Server1/database1/NDT/ftp.csv
work?
File is to be fetched from a server within company.
I need to import CSV file to the cabinet automatically once a day.
I think that the simplest way to go about this is:
Sample code:
var response = nlapiRequestURL('http://yourserver.yourcompany.com/somecsvfile.csv');
var csvDataInBase64 = response.getBody();
var file = nlapiCreateFile('mycsv.csv', 'CSV', csvDataInBase64);
nlapiSubmitFile(file);
There is no error checking or anything in that sample, but it should get you started.
If security matters(see point 1 above!), you are likely best off sending the file via web services. See https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/SuiteTalkWebServices.html for more information.