简体   繁体   English

在NetSuite中,出现错误“子列表库存编号字段库存编号不是子记录字段”

[英]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.

相关问题 NetSuite SuiteScript 2.0如何在N / search create API中指定字段,子列表字段或子记录字段 - NetSuite SuiteScript 2.0 How to specify field, sublist field or subrecord field in N/search create API 是否可以在项目收据的库存明细子记录中有一个自定义字段? 网络套件 - Is it possible to have a custom field in Inventory Detail subrecord on Item Receipt? NETSUITE 客户地址子列表上的NetSuite Script 2.0自定义字段不可编写脚本 - NetSuite Script 2.0 Custom Field on the Customer Address Sublist not scriptable 获取Netsuite客户端脚本内子列表中字段的选择选项 - Get select options for a field in a sublist within a Netsuite client script 我在netsuite中使用批量更新以插入所有销售订单的备注自定义字段(350),我得到了错误消息? - I am using mass update in netsuite to insert the remark custom field of all sales order(350) ,i got error message? NetSuite SuiteScript 2.0 无法以编程方式从用户事件脚本中检索库存详细信息子列表子记录 - NetSuite SuiteScript 2.0 Cannot programmatically retrieve Inventory Details sublist subrecord from user event script 如何将 HTML 放入子列表字段? - How can I put HTML in sublist field? 在Netsuite中建立新的子记录 - Build a new subrecord in Netsuite NetSuite SuiteScript 2.0 无法以编程方式为部分创建的当前记录输入库存详细信息子列表子记录 - NetSuite SuiteScript 2.0 Cannot programmatically enter Inventory Details sublist subrecord for partially created current record 我无法设置字段值 (NetSuite) - I cannot set field value (NetSuite)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM