Does anyone know the reason for a "Invalid price reference key -1" error from NetSuite during Sales Order creation (in a custom flow)? I know I've been able to get past it with a pretty obscure change that didn't seem related to price, but I don't remember it, so I'm hoping that writing it down is helpful next time!
Hi,
Through working with Netsuite, I've discovered that these types of error messages point to inactive or disabled things. Are you using a custom form for the sales order? Is the "rate" sublist field enabled on it?
It looks like you're trying to use -1
for custom pricing, correct?
Did you map it correctly, like this?
Yes, sort of. This is an integration I've inherited, it's works for most records, and its mapping's appearance is:
Which renders to:
{
...
"nlobjSublistIds": {
"item": {
"lines": [
{
"item": "item123",
"quantity": 1,
"price": "-1",
...
"rate": "71"
}
]
}
}
}
That does sound familiar, I haven't checked active/inactive Item records yet.
The mappings are not specifying which form to use but the mappings are mapping to the Items : NS Item Rate field, which I assume was customized by the client since the Output renders it as
{
...
"nlobjSublistIds": {
"item": {
"lines": [
{
"rate": 123
...etc
I think it's also one of those errors that sometimes just goes away for me if I re-create the component in SuiteScript 1.0 mode, but this one was already in that mode.
Oh, I think I did check the items' Inactive state before. Both items on the record correspond to already-active item records in NetSuite.
Where is the "rate" sublist field enabled, is it on the form? Almost all records flow through this successfully.