Applies To
Product: NetSuite 2021.1
Scenario
A user error was thrown when creating an Invoice using REST Web Services. The internal id used for the item is valid and active.
Body:
{
"entity": { "id": "999"},
"item": {
"items": [
{
"item": { "id": "222"}
}
]
}
}
"item": {
"items": [
{
"item": { "id": "222"}
}
]
}
}
Error:
{
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title": "Bad Request",
"status": 400,
"o:errorDetails": [
{
"detail": "Error while accessing resource: You have entered an Invalid Field Value 222 for the following field: item",
"o:errorPath": "item.items[0].item",
"o:errorCode": "USER_ERROR"
}
]
}
Solution
Check the entity record used, the internal id must be valid and active. In this scenario, the entity internal ID 999 does not exist.
- Navigate to Home> Set Preferences
- Go to General> Defaults> Tick Show Internal IDs
- Navigate to Lists> Relationships> Customers
- See valid internal ID and use it in your body as necessary