-2

我越来越

“TypeError _invadjtransRecord.createiewCurrentLineItemSubrecord 不是函数”

尝试以下代码时:

var _invadjtransRecord = nlapiCreateRecord('inventoryadjustment');

_invadjtransRecord.setFieldValue('subsidiary', _subsidiary);
_invadjtransRecord.setFieldValue('account', _itemAccount);
_invadjtransRecord.setFieldValue('trandate',dateVal);
_invadjtransRecord.selectNewLineItem('inventory');
_invadjtransRecord.setCurrentLineItemValue('inventory', 'item', _item);
_invadjtransRecord.setCurrentLineItemValue('inventory', 'location', _location);
_invadjtransRecord.setCurrentLineItemValue('inventory', 'adjustqtyby', _adjQuantity);
var inventoryDetail = _invadjtransRecord.createCurrentLineItemSubrecord('inventory','inventorydetail');
inventoryDetail.selectNewLineItem('inventoryassignment');
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'expirationdate', _expDate);
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'inventorystatus', 1);
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'issueinventorynumber', _invNo);
inventoryDetail.setCurrentLineItemValue('inventoryassignment', 'quantity', _adjQuantity);
inventoryDetail.commitLineItem('inventoryassignment');
inventoryDetail.commit();
4

3 回答 3

2

要使用*Current*子列表 API 的版本,Record对象需要处于动态模式。请参阅参数以nlapiCreateRecord了解如何指定标准或动态模式。

于 2019-10-20T22:03:43.047 回答
0

我要感谢 eng ericgrubaugh对我搜索动态和标准模式记录的帮助,这对我很有帮助。在客户端使用此代码时发生了问题,但它应该在服务器端进行更改

var _invadjtransRecord = nlapiCreateRecord('inventoryadjustment');
to 
var inventoryDetail = _invadjtransRecord.createCurrentLineItemSubrecord('inventory', 'inventorydetail');

参考 SuiteScript 开发人员和参考指南 pdf Suite Answers

非常感谢

于 2019-10-23T10:10:02.617 回答
0

.commit()您添加的inventorylineitems 是否缺少?

于 2019-10-21T15:41:44.887 回答