首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调拨订单转换时出现NetSuite库存详细信息错误

调拨订单转换时出现NetSuite库存详细信息错误
EN

Stack Overflow用户
提问于 2018-07-18 20:17:38
回答 3查看 917关注 0票数 1

我一直收到相同的错误“总库存详细数量必须为1”。在运行此套件时。我尝试了所有我能想象到的方法,但都没有成功。如果有人能帮上忙,我将永远感谢你!

代码语言:javascript
复制
var fulfillment_record = nlapiTransformRecord('transferorder', 534568, 'itemfulfillment',  {recordmode: 'dynamic'});

        fulfillment_record.selectLineItem('item', 1);

        fulfillment_record.setCurrentLineItemValue('item', 'itemreceive', 'T');
        fulfillment_record.setCurrentLineItemValue('item', 'quantity', 1);          

        var subrecord = fulfillment_record.createCurrentLineItemSubrecord('item', 'inventorydetail');
            subrecord.selectNewLineItem('inventoryassignment');
                subrecord.setCurrentLineItemValue('inventoryassignment', 'quantity', 1);
                subrecord.setCurrentLineItemValue('inventoryassignment', 'binnumber', 134);             
            subrecord.commitLineItem('inventoryassignment');
            subrecord.commit();

        fulfillment_record.commitLineItem('item');

    var id = nlapiSubmitRecord(fulfillment_record, true, false);
EN

回答 3

Stack Overflow用户

发布于 2018-11-20 22:31:24

我被告知这是2.0中的一个bug!解决方法是删除IF并使用正确的数量重新创建它

票数 0
EN

Stack Overflow用户

发布于 2018-11-22 01:01:37

也可能是该二进制数是:

  • 不适用于您的位置
  • 不在

中未按正确顺序设置,因为您处于动态模式中

票数 0
EN

Stack Overflow用户

发布于 2021-08-26 19:25:07

当我们进行转换时,父记录中的数据将在子记录中可用。inventoryassignment也将在子记录中可用,因此您可以从inventoryassignment中删除所有行,然后添加所需的值。

这是一个示例SuiteScript 2.0

代码语言:javascript
复制
let invItemSubRec = workOrderBuild.getCurrentSublistSubrecord(
    {
        sublistId: 'component',
        fieldId: 'componentinventorydetail',
    }
);
//Remove lines from sublistSubRecord if they alredy exists.
const lineCount = invItemSubRec.getLineCount({
    sublistId: 'inventoryassignment'
});
if (lineCount > 0) {
    for (var lineIndex = 0; lineIndex < lineCount; lineIndex++) {
        invItemSubRec.removeLine({
            sublistId: 'inventoryassignment',
            line: lineIndex,
            ignoreRecalc: true
        });
    }
}
// set inventoryassignment line values

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51401841

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档