Hello Everyone,
I previously posted on this forum (link here) about importing an Item master using scheduled scripting and manged to get the code working.
Now, I've been trying to use the same approach to import BOMs/Assembly Items into NetSuite.
The code seems to be running with no Syntax error, however, I do not see any results.
I think the problem might be where I use
csvImport.setLinkedFile("item",csvfile2.getValue());Any help is appreciated.function scheduledimporting(type){ var response=nlapiRequestURL('http://www.sfu.ca/~paein/primary.csv',null,null,null); //Request file from FTP servers var response1=nlapiRequestURL('http://www.sfu.ca/~paein/secondary.csv',null,null,null); var body=response.getBody(); var body1=response1.getBody(); var textcontent=body; var textcontent1=body1; var csvfilename1="Primary.csv"; var csvfile=nlapiCreateFile(csvfilename1,"CSV",textcontent); csvfile.setFolder('331'); //refrencing to a folder ID var mytxtfileId = nlapiSubmitFile(csvfile); //returns out file id //secondary var csvfilename2="Secondary.csv"; var csvfile2=nlapiCreateFile(csvfilename2,"CSV",textcontent1); csvfile2.setFolder('331'); //refrencing to a folder ID var mytxtfileId2 = nlapiSubmitFile(csvfile2); //returns out file id //Import Process var csvMap = 'CUSTIMPORT100200'; //saved CSV import id var csvImport = nlapiCreateCSVImport();//creating a new csv import csvImport.setMapping(csvMap);//setting import map csvImport.setPrimaryFile(csvfile.getValue());//file to be imported csvImport.setLinkedFile("item",csvfile2.getValue());//nlapiLoadFile(4000)); //csvImport.setLinkedFile("itemMembers",nlapiLoadFile(4000)); csvImport.setOption("jobName", "MutipleFileImport-BOM"); var csvSubmitId = nlapiSubmitCSVImport(csvImport);//submitting the CSV }