1
netsuiteにビン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