When I try to load and save vendor bill record in ...
# suitescript
g
When I try to load and save vendor bill record in SuiteScript, I got an unexpected error This is my code and the error result.
Copy code
var recObj = record.load({
                type: record.Type.VENDOR_BILL,
                id: 26466592
             })
             recObj.save();
m
Is there a field on the record labeled source?
r
We're seeing this crop up as well on multiple client accounts. Currently have a ticket open with NS.
g
Thanks, @Rob Witting
This issue has not been resolved yet?
r
Can you ignore mandatory fields as true while saving the record. Might provide you a temporary solution.
g
Thanks, but the issue is already fixed this morning
I think it was NS internal error
1
r
This is what happens when you have a mandatory field that's not populated. Apparently Source became mandatory, perhaps in error.
You can use
.save({ignoreMandatoryFields: true})
to resolve in the future.
z
The another reason can be a form. When you load/save the record with suitescript, it is working in the background open/submit UI form. NetSuite execute the script AS current user, and you should check what is the preferred form for that user. Another way is forcing which forn is used while script is executed (parameter forn in the load)
When I create an integration with NetSuite, I always have "intergration user" and make tokens for it. Then is possible to make preferred forms for all records accessible from integration requests