Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Retrieve CSV Import errors using Restlet
I want to retrieve the errors for a CSV Import job. Co-pilot suggested I could use this code but it fails on 'search.create' - I am guessing cause there is an issue with 'csvimporterror' which I do not see as a valid type. Can this code be fixed or is there some other code that will do the job?
function getErrors(requestParams) {
var jobId = requestParams.jobId;
var errorSearch = search.create({
type: 'csvimporterror',
filters: [
['csvimportjob', 'is', jobId]
],
columns: ['line', 'errormessage']
});
var errors = [];
errorSearch.run().each(function(result) {
errors.push({
line: result.getValue('line'),
errorMessage: result.getValue('errormessage')
});
return true;
});
return errors;