1
我想要在netsuite中執行bin itemfulfillment
。itemfulfillment:子列表項目字段inventorydetail不是子記錄字段
但我無法得到一個有效的例子。當我運行下面的代碼,我收到此錯誤:
Sublist item field inventorydetail is not a subrecord field
我需要知道什麼是正確的子記錄的名稱創建一個itemfulfillment
謝謝!
var sales_internalid = '2465'; //saleorderid
var einternalid = '110'; //employeeid
var winternalid = '1'; //washsoueid
var sinternalid = '6'; //itemid
var quantity = 1;
var displayname ='iphone';
var shipgroup = 1;
var salesOrder= nlapiCreateRecord('salesorder', sales_internalid, {recordmode: 'dynamic'});
var obj = nlapiTransformRecord('salesorder', sales_internalid, 'itemfulfillment');
obj.selectLineItem('item',1);
obj.setCurrentLineItemValue('item', 'item', sinternalid);
obj.setCurrentLineItemValue('item', 'location', winternalid);
obj.setCurrentLineItemValue('item', 'quantity', 1);
var subrecord= obj.editCurrentLineItemSubrecord('item', 'inventorydetail');
subrecord.selectLineItem('inventoryassignment', 1);
subrecord.selectNewLineItem('inventoryassignment');
subrecord.setCurrentLineItemValue('inventoryassignment', 'inventorynumber', '1');
subrecord.setCurrentLineItemValue('inventoryassignment', 'quantity', '1');
subrecord.commitLineItem('inventoryassignment');
subrecord.commit();
obj.commitLineItem('item');
var fulfillmentOrderId = nlapiSubmitRecord(itemFulfillment, true);
評論語法 – Fabien