找不到键为[orderLine],值为[1]的子列表项的匹配行 [英] Unable to find a matching line for sublist item with key: [orderLine] and value: [1]

查看:143
本文介绍了找不到键为[orderLine],值为[1]的子列表项的匹配行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SuiteTalk从现有销售订单中创建物料履行.这适用于非序列化订单,但不适用于序列化SO.

I am using SuiteTalk to create an item fulfillment from an existing sales order. This works for non-serialized orders, but not for serialized SOs.

我收到以下错误:

无法找到键为[orderLine],值为[1]的子列表项的匹配行.

Unable to find a matching line for sublist item with key: [orderLine] and value: [1].

但是,行号确实匹配,因为只有一行,并且行号为"1".订单项确实有3个数量,每个项目都使用相同的行号分别添加到履行中.这可能是问题吗?

The line numbers do however match, since there is only one line, and this has line number "1". The line item does have a quantity of 3, each item being added to the fulfillment separately with the same line number. Could this be the problem?

我的代码:

ItemFulfillmentItem ffItem = new ItemFulfillmentItem();
ffItem.item = ifitemlist.item[b].item;
ffItem.itemReceive = true;
ffItem.itemReceiveSpecified = true;
ffItem.itemIsFulfilled = true;
ffItem.itemIsFulfilledSpecified = true;
ffItem.orderLineSpecified = true;
ffItem.orderLine = ifitemlist.item[b].orderLine;
ffItem.quantity = msg.despatchCartons[i].items[a].qtyDespatched;
ffItem.quantitySpecified = true;
ifitems.Add(ffItem);

对于特定的实现,上面的代码运行3次.这是因为该行中的3个项目都有单独的序列号.

For the specific fulfillment, the above code runs 3 times. This is because each of the 3 items on this Line has a separate serial number.

任何帮助将不胜感激.预先感谢!

Any help would be appreciated. Thanks in advance!

推荐答案

要解决此问题,您需要为项目实现"记录上的每一行创建一个库存明细"记录.库存明细记录将包含特定订单项的序列号和每个序列号的数量.

To resolve this, you need to create an Inventory Detail record for each line on the Item Fulfillment record. The Inventory Detail record will contain the serial number and quantity per serial number for the specific line item.

为此,使用用户事件脚本的SuiteScript 2.0代码:

The SuiteScript 2.0 code for this, using a User Event script:

var currentRecord = scriptContext.currentRecord;
var subrecordInvDetail = currentRecord.getSublistSubrecord({
       sublistId: 'item',
       fieldId: 'inventorydetail',
       line: item_line_num
});

为当前行中的每个序列号运行以下代码:

Run the following code for each serial number on your current line:

subrecordInvDetail.setSublistValue({
     sublistId: 'inventoryassignment',
     fieldId: 'issueinventorynumber',
     line: serial_num_line,
     value: 'Serial_Number'
});
subrecordInvDetail.setSublistValue({
     sublistId: 'inventoryassignment',
     fieldId: 'quantity',
     line: serial_num_line,
     value: 'Quantity_Value'
});
subrecordInvDetail.save();

这篇关于找不到键为[orderLine],值为[1]的子列表项的匹配行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆