I'm trying to import CSV files automatically into Netsuite . ( For example, I'd like netsuite to check a specific root folder once a night and pull in or import those CSV files in to Netsuite. For example, I'd like some BOM information to be imported and mapped to Netsuite variables?
Is this possible? if not, would I at least be able to notify the user that there is a new file in a specific folder waiting to be imported?
p.s can i import regular xls files instead of csv?
Thanks for all your help.
Cheers,
James
Update this is what I have so far, not sure if It would work as one is SuiteScript one Portlet
function scheduledimporting(type){
var csvMap = '15'; //saved CSV import id
//var csvFile = nlapiLoadFile("5828"); //csv file id from filecabinet
var urlrequest=nLapiRequestURL('https://...........',null,a);
var body=response.getBody(); //get the body of the message
var csvImport = nlapiCreateCSVImport();//creating a new csv import
/***
If the file that I'm pulling in is a CSV, would i get the body as CSV?
DO I still need to go through Prsing the body and transform it to JSON Object
If I do, how would I transfer it back to CSV ?
***/
csvImport.setMapping(csvMap);//setting import map
csvImport.setPrimaryFile(body.getValue());//file to be imported
csvImport.setOption("jobName", "Test1111");//setting job status' job name
var csvSubmitId = nlapiSubmitCSVImport(csvImport);//submitting the CSV
}