Roy Mustang
Roy Mustang

Reputation: 33

Netsuite Restlet - inserting sales order

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>."
 }
}

Upvotes: 1

Views: 1657

Answers (1)

iloveitaly
iloveitaly

Reputation: 2165

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

Upvotes: 1

Related Questions