我收到来自netsuite的错误消息
The field custevent97 contained more than the maximum number ( 5 ) of characters allowed
You have entered an Invalid Field Value 1511 for the following field: contact
Phone number should have seven digits or more.
很难理解哪个字段是错误的,哪个值是错误的。
如何从suitescript 2.0获取具有特定字段的标签名称的错误消息?
AFAIK,当您尝试保存记录时,NetSuite将返回上述所有错误。因此,覆盖它们并不容易,但您可以使用下面的解决方法。
在try-catch块中编写代码,然后验证错误消息以检查某些字段值是否无效。如果字段值无效,则可以使用nsRecord.getField
从记录中获取所述字段,然后使用field.label获取其标签,并覆盖错误消息。