Hi, I'm trying to create a csv file with the below code that I found at this website (http://emergetech.com/netsuite-customization/netsuite-customization-creating-a-csv-from-a-saved-search-part2) , but I'm getting an error that the nlapiCreateFile is not defined.
function createFile(){ try{ var searchResults = nlapiSearchRecord(null, 'customsearchnl_labour_cost'); var csvBody = '' if (searchResults == null || searchResults.length < 1) return; for (var i=0; i<searchResults.length; i++){ csvBody += searchResults[i].getValue('date') + ','; csvBody += searchResults[i].getValue('account') + ','; csvBody += searchResults[i].getValue('amount') + 'n'; } var file = nlapiCreateFile('nl_labour_cost.csv', 'CSV', csvBody); file.setFolder('96'); nlapiSubmitFile(file); }catch(e){ nlapiLogExecution('Error', 'createFile', 'Error while creating file – ' + e.message); } }Any ideas?Thanks!