nzaleski
07/06/2020, 7:37 PMtask
module. I am not getting a particular useful error log, just that FAILED_TO_SUBMIT_JOB_REQUEST_1
.
I think the only problem I have is with the CsvImportTask.linkedFiles
. It says it takes a key value pair. Not sure what the key
is. Here is the example NS gives scriptTask.linkedFiles = {'addressbook': 'street,city\nval1,val2', 'purchases': file.load('SuiteScripts/other.csv')};
in this example they used addressbook
and purchases
. Where do they get the internal id, is it the record browser, analytical browser, not sure what the internal id is of the linked record?
For my specific case, I am trying to use the Sales Order Items
for the linked file. Not sure what the internal id is for that, is it just 'items' ?battk
07/06/2020, 8:13 PMnzaleski
07/06/2020, 8:28 PMnzaleski
07/06/2020, 8:29 PMbattk
07/06/2020, 8:40 PMbattk
07/06/2020, 8:40 PMrequire(["N/task", "N/file"], function (task, file) {
var scriptTask = task.create({ taskType: task.TaskType.CSV_IMPORT });
scriptTask.mappingId = 2;
scriptTask.importFile = "number,entity,location\r\nSOT1,9,1";
scriptTask.linkedFiles = { item: "number,item,amount\r\nSOT1,9,9" };
scriptTask.submit();
});
battk
07/06/2020, 8:41 PM