Hey community,
I created a suitelet using SDF and Suitescript 2.1,
I'm trying to automate the creation of transfer orders but when I try to set the item in the item sublist Netsuite won't accept any value I give it,
I already tried with the inventory item id (integer and string), the name, the code, I tried pulling the inventory item record and setting it with that but still it won't accept it, does anybody know what value should I use to create these items in the transfer order?
I tried all of this with both dynamic and not dynamic records/code.
I'll share a little bit of the code and the error,
var transferOrder = recordModule.create({
type: 'TRANSFERORDER',
});
var inventoryItem = record.load({
type: 'INVENTORYITEM',
id: 1064,
isDynamic: true,
});
transferOrder.insertLine({
sublistId: 'item',
line: 0,
});
transferOrder.setSublistValue({
sublistId: 'item',
fieldId: 'item',
line: 0,
//non of these values work for me
value: inventoryItem,
// value: 1064,
// value: '1064',
// value: 'IND-PRM35-SS-XS'
});
this is the error I get for any value I try to set there
{"type":"error.SuiteScriptError","name":"INVALID_FLD_VALUE","message":"You have entered an Invalid Field Value IND-PRM35-SS-XS for the following field: item","stack":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js:371:13)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n at createTransferOrderRecord (/SuiteApps/com.netsuite.oursuitecloud/warehouse.js:132:17)\n at Object.onRequest (/SuiteApps/com.netsuite.oursuitecloud/warehouse.js:37:5)"],"cause":{"type":"internal error","code":"INVALID_FLD_VALUE","details":"You have entered an Invalid Field Value IND-PRM35-SS-XS for the following field: item","userEvent":null,"stackTrace":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js:371:13)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n at createTransferOrderRecord (/SuiteApps/com.netsuite.oursuitecloud/warehouse.js:132:17)\n at Object.onRequest (/SuiteApps/com.netsuite.oursuitecloud/warehouse.js:37:5)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":true}