问题
I want to get job status information of CSV imports in NetSuite by using SuiteScript. for this I used
search.create({
type: search.Type.JOB_STATUS,
filters: null,
columns: ['internalid']
})
But I think I am using wrong search.
回答1:
You need the csv import ID, If you are using suitecript
create your import
var scriptTask = task.create({taskType: task.TaskType.CSV_IMPORT});
scriptTask.mappingId = 201; //Id for you saved import for example
var file = file.load({id: fileId});
scriptTask.importFile = file;
var csvImportTaskId = scriptTask.submit(); //Here you get de CSV Import Id
After you get the csvimport id you can query the status:
var csvTaskStatus = task.checkStatus({
taskId: csvImportTaskId
});
if (csvTaskStatus.status === task.TaskStatus.FAILED) // you code goes here
This is the status that you will get
- PENDING
- PROCESSING
- COMPLETE
- FAILED
If you query the status right after you submit the csv Import you will always get pending status, you shoud wait some time csv import gets into a queue and it takes time to start processi
来源:https://stackoverflow.com/questions/63152421/netsuite-csv-import-status-search