item receive 的 submit

nlapiSubmitRecord(itemreceipt,true,true);

最后这个 true 很关键 对于itemreceipt对象来说:

ignoreMandatoryFields {boolean} [optional] - Disables mandatory field validation for
this submit operation. If set to true, ignores all standard and custom fields that were
made mandatory through customization. All fields that were made mandatory
through company preferences are also ignored.
Important: Use the ignoreMandatoryFields argument with caution. This argument
should be used mostly with Scheduled scripts, rather than User Event scripts. This
ensures that UI users do not bypass the business logic enforced through form
customization.

都这系统一般会提示:

出错: USER_ERROR
请输入值:成本分配方法, 来源, 来源, 来源
堆栈跟踪: main(**.js:496)


纠正错误,欢迎探讨:
打开微信-发现-扫一扫
原文地址:https://www.cnblogs.com/backuper/p/1492913.html