How to assign multiple bins to a single line item in item fulfillment record using user event suitescript 2.0 in static mode?
How to assign multiple bins to a single line item in item fulfillment record using user event suitescript 2.0 in static mode?
When I attempt to do that, I get the following error:
| {“type”:”error.SuiteScriptError”,”name”:”USER_ERROR”,”message”:”Please configure the inventory detail in line 1 of the item list.”,”id”:””,”stack”:[“anonymous(N/serverRecordService)”,”afterSubmit(/SuiteScripts/soToship.js:309)”],”cause”:{“type”:”internal error”,”code”:”USER_ERROR”,”details”:”Please configure the inventory detail in line 1 of the item list.”,”userEvent”:”aftersubmit”,”stackTrace”:[“anonymous(N/serverRecordService)”,”afterSubmit(/SuiteScripts/soToship.js:309)”],”notifyOff”:false},”notifyOff”:false,”userFacing”:false} |
Here is the code:
var fulfillment = record.transform({
fromType: record.Type.SALES_ORDER,
fromId: salesOrderid,
toType: record.Type.ITEM_FULFILLMENT,
isDynamic: false
var subrecord = fulfillment.getSublistSubrecord({
sublistId: ‘item’,
fieldId: ‘inventorydetail’,
line: j,
ignoreRecalc: true
});
for(var i =0 ; i<subrecord.length; i++){
if(subrecord[i].quantity) {
try {
subrecord.setSublistValue({
sublistId:’inventoryassignment’,
fieldId:’binnumber’,
line: i,
value: subrecord[i].binnumber});
subrecord.setSublistValue({
sublistId: ‘inventoryassignment’,
fieldId: ‘quantity’,
line: i,
value: subrecord[i].quantity
});
}
}
Hi,
There are a few pieces that you’re missing.
This is a good sample:
https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4687606595.html
Thanks,
Chris
Hi Chris,
Thank you, I got it resolved.



