Last ditch effort here When attempting to update a...
# suitetalkapi
g
Last ditch effort here When attempting to update an itemreceipt via REST i keep getting the following response:
Copy code
{
  "type": "<https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1>",
  "title": "Bad Request",
  "status": 400,
  "o:errorDetails": [
    {
      "detail": "Error while accessing a resource. You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.",
      "o:errorPath": "item",
      "o:errorCode": "USER_ERROR"
    }
  ]
}
My Payload is:
Copy code
{
  "item": {
    "items": [
      {
        "orderLine": 1,
        "location": 3
      },
      {
        "orderLine": 2,
        "location": 3
      }
    ]
  }
}
doing PATCH /itemReceipt/{receiptID}
a
not an expert in this area but I'm pretty sure NS doesn't support PATCH
g
Have been using it in other places fine, i've since spotted the issue is actually with line id generation, line 1 works fine, the 2nd line is called Line 4 for reasons totally unknown 🤷
👍 1
i
are you doing a get before to know what line to update?
looking at some item receipts on my end the orderline is always a multiple of 3
b
the line field refers to the line id
it is not always the line sequence number
on fulfillments and receipts, the line id actaully increases by more than 1 for every line, since each line actually represents multiple general ledger impacts
similarly, the order line field represents the line id of the matching line from the order that the receipt was created from
i
Yeah I guess the question is what is the originating transaction if the item receipt. PO and TO behave differently
g
I've been trying to work out what determines the sequence. Turns out there is just no rhyme or reason, or at least nothing that can be guessed.
So yeah, i'll have to do a GET and figure out the line ID's that way.