问题
I'm trying to insert in sales order through suitescript and I always get an error on 'Location'. here's my request
{
"recordtype" : "salesorder",
"entity" : "142832",
"location" : {
"id":"395"
}
}
and this is the response
{
"error": {
"code": "USER_ERROR",
"message": "Please enter value(s) for: Location"
}
}
and I tried changing the location value for example
"location" : "390"
the result would be
{
"error": {
"code": "INVALID_KEY_OR_REF",
"message": "Invalid location reference key 390 for subsidiary <NULL>."
}
}
回答1:
This error is occurring because the location is not "accessible" by the subsidiary associated with the customer. Subsidiaries are defined on the customer level, not on the sales order. You need to ensure the subsidiary chosen on the customer is contained within the subsidiary hierarchy of the location. To fix the issue you need to adjust the associated subsidiary of the location.
Here's more information on how to fix a very similar issue with items:
https://dashboard.suitesync.io/docs/resolving-errors#im-seeing-a-invalid-item-reference-key-123-for-subs
来源:https://stackoverflow.com/questions/48297799/netsuite-restlet-inserting-sales-order