[英]In NetSuite I am getting the error “Sublist inventorynumber field inventorynumber is not a subrecord field”
We do not have inventoryassignment set up. 我们没有设置库存分配。 I am trying to create a new returnauthorization record.
我正在尝试创建新的退货授权记录。 I can attach the item but I can't seem to update the fields in the item or populate the inventorynumber with the serial number.
我可以附加物料,但似乎无法更新物料中的字段或使用序列号填充库存编号。 If you populate the field on the form by hand it works, but I can't get it to work in the restlet.
如果您手动填写表单上的字段,则可以使用,但是我无法在Restlet中使用它。
When trying to populate the inventorynumber I get the error "Sublist inventorynumber field inventorynumber is not a subrecord field". 尝试填充清单编号时,出现错误“子列表清单编号字段清单编号不是子记录字段”。
// create new rma record
var rmarecord=nlapiCreateRecord('returnauthorization');
rmarecord.setFieldValue('customform','116'); // form is RMA
rmarecord.setFieldValue('department', '55');
rmarecord.setFieldValue('class', '56');
rmarecord.setFieldValue('location', '20');
rmarecord.setFieldValue('otherrefnum', datain.ponumber);
rmarecord.setFieldValue('custbody2', datain.rma);
rmarecord.setFieldValue('custbody3', datain.problemdesc);
rmarecord.setFieldValue('entity', datain.customerid);
// Select Line Item
rmarecord.selectNewLineItem('item');
rmarecord.setCurrentLineItemValue('item', 'item', itemrecordid);
rmarecord.setCurrentLineItemValue('item', 'rate', '0');
rmarecord.setCurrentLineItemValue('item', 'amount', '0');
rmarecord.setCurrentLineItemValue('item', 'quantity', '1');
rmarecord.setCurrentLineItemValue('item', 'pricelevel', '0'); // Custom
var inventorydetailrecord = rmarecord.createCurrentLineItemSubrecord('item', 'inventorynumber');
inventorydetailrecord.selectNewLineItem('inventorynumber');
inventorydetailrecord.setCurrentLineItemValue('inventorynumber', 'inventorynumber', datain.serial);
inventorydetailrecord.commitLineItem('inventorynumber');
inventorydetailrecord.commit();
rmarecord.commitLineItem('item');
var rmaid = nlapiSubmitRecord(rmarecord,false,true);
Try with 试试看
inventorydetailrecord.setCurrentLineItemValue('inventorynumber', 'inventorydetail', datain.serial); 库存明细记录.setCurrentLineItemValue('inventorynumber','inventorydetail',datain.serial);
EDITED: I have just noticed that you have written that you not using inventoryassignment. 编辑:我刚刚注意到您已经写到您没有使用库存分配。 In this case, you don't have the inventory detail subrecord, instead, try to set values to a field called "serialnumbers" :
在这种情况下,您没有库存明细子记录,而是尝试将值设置为名为“ serialnumbers”的字段:
rmarecord.setCurrentLineItemValue('item', 'serialnumbers',datain.serial);
Anyhow, if you will decide to use inventoryassignment, please find below the explanation regarding the inventory detail subrecord. 无论如何,如果您决定使用库存分配,请在下面找到有关库存明细子记录的说明。
The subrecord field id is "inventorydetail" 子记录字段ID为“库存详细信息”
The sublist id inside the inventory detail sub record is called "inventoryassignment". 库存明细子记录内的子列表ID称为“库存分配”。
The serial number field id inside the inventory assignment sublist is "receiptinventorynumber". 库存分配子列表中的序列号字段ID为“ receiptinventorynumber”。
Please see the code snippet below in order to update the SN inside the subrecord: 请查看下面的代码片段,以更新子记录内的SN:
var inventorydetailrecord = rmarecord.createCurrentLineItemSubrecord('item', 'inventorydetail');
inventorydetailrecord.selectNewLineItem('inventoryassignment');
inventorydetailrecord.setCurrentLineItemValue('inventoryassignment', 'receiptinventorynumber', datain.serial);
inventorydetailrecord.commitLineItem('inventoryassignment');
inventorydetailrecord.commit();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.