NetSuite Rest create itemFulfillment from salesOrder Transform with Lot #s

30 Views Asked by At

I have .Net App that creates an itemFulfillment from a salesOrder and updates it with information about what is shipped uing teh folloinw URL:

https://{{COMPANY_URL}}/services/rest/record/v1/salesorder/{{SOID}}/!transform/itemFulfillment

with a Body like:

{
"item": {
    "items": [
        {
            "orderLine": 1,
            "location": 16,
            "quantity": 2,
            "itemReceive": true
        },
        {
            "orderLine": 2,
            "location": 16,
            "itemReceive": false
        }

    ]
}

}

We now have some items that are Lot Controlled. And it's failing with: Error while accessing a resource. Please configure the inventory detail in line 1 of the item list.

I tried to change the body to:

{
"item": {
    "items": [
        {
            "orderLine": 1,
            "location": 16,
            "quantity": 2,
            "custcol_wayb_serial_number": "PI-NN001503",
            "inventoryDetail": {
                "inventoryAssignment": {
                    "items": [
                        {
                            "issueInventoryNumber": "22CWB08-2",
                            "quantity": 2
                        }
                    ]
                }
            }
        },
        {
            "orderLine": 2,
            "location": 16,
            "itemReceive": false
        }
    ]
}

}

But it is currently erroring out with: Error while accessing a resource. You have entered an Invalid Field Value 22CWB08-2 for the following field: issueinventorynumber.

From what I see online, when looking at what people have scripted, I may have to pass in the id of the inventoryNumber. But I only have the actual text of the lot #. When I try to query inventoryNumber, I may get multiple records if it's at multiple locations and I need to get just the one at a specific location. There doesn't seem to be a way to query by location.

So my questions are:

  1. How do I fix this code to solve the issue with create itemFulfillment?
  2. If I need the invetoryNumber's Id, how do I get it by lot # and location?

Currently I'm just trying to prototype this in PostMan. Once I have that working, I can code it easily in.Net.

0

There are 0 best solutions below