gpt4 book ai didi

javascript - Netsuite(库存明细)

转载 作者:行者123 更新时间:2023-11-30 15:49:41 27 4
gpt4 key购买 nike

我需要使用批号装配/ Material list 详细信息配置库存详细信息。我尝试了以下代码来实现这一点。

        var recordScreate = nlapiCreateRecord('inventoryadjustment')
recordScreate.setFieldValue('account', 850);
recordScreate.setFieldValue('adjlocation', locationSvalue);
recordScreate.setFieldValue('custbody_cseg1', jbSvalue);


recordScreate.setCurrentLineItemValue('inventory', 'item', fgSvalue);
recordScreate.setCurrentLineItemValue('inventory', 'location',locationSvalue);
recordScreate.setCurrentLineItemValue('inventory', 'adjustqtyby',-hproductionSscrap);``



var inventoryDetail = recordScreate.createCurrentLineItemSubrecord('inventory', 'inventorydetail');
inventoryDetail.selectNewLineItem('inventoryassignment');
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'issueinventorynumber',2793);
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'quantity', -hproductionSscrap);
inventoryDetail.commitLineItem('inventoryassignment');
inventoryDetail.commit();

recordScreate.commitLineItem('inventory');`

我得到了Error_ "Invalid issueinventorynumber reference key 2793.0" 任何人都可以帮助解决这个问题。

最佳答案

嘿伙计们,感谢您的支持。最后我得到了答案。记录存在。我做了什么……

我只是将该 id 传递给不是整数的字符串格式,例如“2739”而不是 2739。更正后的代码如下...

var recordScreate = nlapiCreateRecord('inventoryadjustment')
recordScreate.setFieldValue('account', 850);
recordScreate.setFieldValue('adjlocation', locationSvalue);
recordScreate.setFieldValue('custbody_cseg1', jbSvalue);


recordScreate.setCurrentLineItemValue('inventory', 'item', fgSvalue);
recordScreate.setCurrentLineItemValue('inventory', 'location',locationSvalue);
recordScreate.setCurrentLineItemValue('inventory', 'adjustqtyby',-hproductionSscrap);``



var inventoryDetail = recordScreate.createCurrentLineItemSubrecord('inventory', 'inventorydetail');
inventoryDetail.selectNewLineItem('inventoryassignment');
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'issueinventorynumber','2793');
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'quantity', -hproductionSscrap);
inventoryDetail.commitLineItem('inventoryassignment');
inventoryDetail.commit();

recordScreate.commitLineItem('inventory');

关于javascript - Netsuite(库存明细),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39589965/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com