Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
CSV Import - Unexpected Error
Hi,
This is my first try at running a CSV Import from a file attached to a case. I'm having no trouble pulling the file with a saved search, but I keep getting:
"UNEXPECTED ERROR during CSV Import process" on nlapiSubmitCSVImport()
Here is what I'm working with:
function importCsvFile(){ var messageSearch = nlapiSearchRecord("message",null, //start by setting up criteria [ ["subject","contains","ITEMIMPORT"], "AND", ["messagedate","within","today"] ], //and then the results page [ new nlobjSearchColumn("internalid","attachments",null) ] ); for (var i=0;i<=messageSearch.length-1; i++){ nlapiLogExecution('debug','test',i); var fileId = messageSearch[i].getValue('internalid','attachments',null); nlapiLogExecution('debug','fileId = ',fileId); var import = nlapiCreateCSVImport(); import.setPrimaryFile(nlapiLoadFile(fileId)); import.setMapping('CUSTIMPORTImportItemMapping'); import.setOption('jobName','itemImport'); var importId = nlapiSubmitCSVImport(import); nlapiLogExecution('debug','importId = ',importId); } } 0