故障
更改Item Receipt的时候需要涉及quantity更新的情况,此时Inventory Detail和Quantity两个字段互相羁绊,先改哪个都会导致另一个字段验证错误。其他土办法比如itemreceive=false,或者置空location字段都在UI上可以实现效果,但是在脚本中都会造成inventory detail quantity错误。
问题
以下哪一个办法是良药:
- Record.removeCurrentSublistSubrecord()清空inventory detail再写入quantity
- Record.removeCurrentSublistSubrecord()清空inventory detail先写入inventory detail再写入quantity
- SubrecordObj.removeLine()之后写入新的inventoryassignment
- 用Record.hasCurrentSublistSubrecord()做判断再使用Record.removeCurrentSublistSubrecord()
结论
Record.removeCurrentSublistSubrecord()不会引发inventory detail quantity must be x的错误,但是会导致unexpected error。
这种情况是由于isDynamic: true造成的,使用dynamic mode则会永无天日,使用standard mode你会平安落地。
Comments