My Products
Help
AllanEgebjerg
CONTRIBUTOR ***

Cannot update lotSerialNbr on shipment allocations

by AllanEgebjerg

I am trying to update a shipment via [PUT] /controller/api/v1/shipment/{shipmentNbr}

The inventory is set to "Tracking track serial numbers", and I am via Financials UI, allowed to make allocations and update serial numbers on each allocation.
But when I try to do the same via api, the allocations are created, but are not updated with the serial numbers I specify. Instead, all the lines are set with the serial number specified on shipmentDetailLines, if I set it there. If I omit it there,  it is simply not set on the allocations. 

 

Here is my request content

 

 

{
  "shipmentType": {
    "value": "Issue"
  },
  "operation": {
    "value": "Issue"
  },
  "shipmentDate": {
    "value": "2020-12-30T15:41:38.044Z"
  },
  "shipmentDetailLines": [
    {
      "operation": "Update",
      "lineNumber": {
        "value": 1
      },
      "shippedQty":{
         "value": 3
      },
                 
      "allocations": [
        {
          "operation": "Insert",
          "lineNbr": {
             "value": 10
          },
	  "lotSerialNbr": {
            "value": "1234510"
          },
	  "quantity": {
            "value": "1"
          }
        }, 
{
          "operation": "Insert",
          "lineNbr": {
             "value": 11
          },
	  "lotSerialNbr": {
            "value": "1234511"
          },
	  "quantity": {
            "value": "1"
          }
        },
{
          "operation": "Insert",
          "lineNbr": {
             "value": 12
          },
	  "lotSerialNbr": {
            "value": "1234512"
          },
	  "quantity": {
            "value": "1"
          }
        }
      ]
    }
  ]
}

 

 

 

The result on the shiment allocation UI in Financials UI, can be seen in the attachment. 

 
 

Company id: 3011577

Shipment 000005

 

 

7 REPLIES 7
AllanEgebjerg
CONTRIBUTOR ***

by AllanEgebjerg

Screen shot of lot/serial class is attached. 

 

About the allocation lines. That is another wierd thing. If I look in the UI there are no allocation lines before, but if I fetch the shipment in the api, there are some allocation lines already. But if I try to update the allocations, using the lineNbr, it returns an error, indicating that it can't find the allocation line. 

 

Here is the result from GET shipment

{
  "shipmentNumber": "000005",
  "shipmentType": "Issue",
  "status": "Open",
  "hold": false,
  "operation": "Issue",
  "shipmentDate": "2020-12-30T00:00:00",
  "customer": {
    "internalId": 2846,
    "number": "10000",
    "name": "Allan"
  },
  "location": {
    "id": "HOVED",
    "name": "Hovedlokasjon"
  },
  "fromWarehouse": {
    "id": "1",
    "description": "Hovedlager"
  },
  "currencyId": "DKK",
  "shippedQuantity": 3,
  "shippedWeight": 0,
  "shippedVolume": 0,
  "packagesWeight": 0,
  "controlQuantity": 3,
  "deliveryAddress": {
    "overrideAddress": false,
    "addressId": 23,
    "country": {
      "id": "DK",
      "name": "DANMARK"
    }
  },
  "deliveryContact": {
    "overrideContact": false,
    "contactId": 24,
    "name": "Allan",
    "email": "alm@apportsystems.com"
  },
  "residentialDelivery": false,
  "saturdayDelivery": false,
  "useCustomerAccount": false,
  "insurance": false,
  "freightCost": 0,
  "freightAmt": 0,
  "transactionType": {
    "id": 0,
    "description": "Ingen (unntatt)"
  },
  "modeOfTrasport": {
    "id": 10,
    "description": "Unknown"
  },
  "container": false,
  "shipmentDetailLines": [
    {
      "lineNumber": 1,
      "orderType": "SO",
      "orderNbr": "000004",
      "inventoryNumber": "333333",
      "freeItem": false,
      "warehouse": {
        "id": "1",
        "description": "Hovedlager"
      },
      "location": {
        "id": "1",
        "name": "Standard"
      },
      "uom": "STK",
      "shippedQty": 3,
      "orderedQty": 3,
      "openQty": 0,
      "lotSerialNbr": "",
      "description": "Testvare 3",
      "allocations": [
        {
          "lineNbr": 20,
          "itemId": "333333",
          "location": {
            "id": "1",
            "name": "Standard"
          },
          "lotSerialNumber": "",
          "quantity": 1,
          "uom": "STK",
          "description": "Testvare 3"
        },
        {
          "lineNbr": 21,
          "itemId": "333333",
          "location": {
            "id": "1",
            "name": "Standard"
          },
          "lotSerialNumber": "",
          "quantity": 1,
          "uom": "STK",
          "description": "Testvare 3"
        },
        {
          "lineNbr": 22,
          "itemId": "333333",
          "location": {
            "id": "1",
            "name": "Standard"
          },
          "lotSerialNumber": "",
          "quantity": 1,
          "uom": "STK",
          "description": "Testvare 3"
        }
      ],
      "orderLineNbr": 1
    }
  ],
  "shipmentOrderLines": [
    {
      "orderType": "SO",
      "orderNbr": "000004",
      "shippedQty": 3,
      "shippedWeight": 0,
      "shippedVolume": 0,
      "note": ""
    }
  ],
  "lastModifiedDateTime": "2021-02-04T09:48:52.5",
  "note": "",
  "metadata": {
    "totalCount": 1,
    "maxPageSize": 1000
  }
}
AllanEgebjerg
CONTRIBUTOR ***

by AllanEgebjerg

Correction: (Had updated shippedQty on the last GET shipment output. When shippedQty=0 it looks like this, with no allocations)

 

{
  "shipmentNumber": "000005",
  "shipmentType": "Issue",
  "status": "Open",
  "hold": false,
  "operation": "Issue",
  "shipmentDate": "2020-12-30T00:00:00",
  "customer": {
    "internalId": 2846,
    "number": "10000",
    "name": "Allan"
  },
  "location": {
    "id": "HOVED",
    "name": "Hovedlokasjon"
  },
  "fromWarehouse": {
    "id": "1",
    "description": "Hovedlager"
  },
  "currencyId": "DKK",
  "shippedQuantity": 0,
  "shippedWeight": 0,
  "shippedVolume": 0,
  "packagesWeight": 0,
  "controlQuantity": 0,
  "deliveryAddress": {
    "overrideAddress": false,
    "addressId": 23,
    "country": {
      "id": "DK",
      "name": "DANMARK"
    }
  },
  "deliveryContact": {
    "overrideContact": false,
    "contactId": 24,
    "name": "Allan",
    "email": "alm@apportsystems.com"
  },
  "residentialDelivery": false,
  "saturdayDelivery": false,
  "useCustomerAccount": false,
  "insurance": false,
  "freightCost": 0,
  "freightAmt": 0,
  "transactionType": {
    "id": 0,
    "description": "Ingen (unntatt)"
  },
  "modeOfTrasport": {
    "id": 10,
    "description": "Unknown"
  },
  "container": false,
  "shipmentDetailLines": [
    {
      "lineNumber": 1,
      "orderType": "SO",
      "orderNbr": "000004",
      "inventoryNumber": "333333",
      "freeItem": false,
      "warehouse": {
        "id": "1",
        "description": "Hovedlager"
      },
      "location": {
        "id": "1",
        "name": "Standard"
      },
      "uom": "STK",
      "shippedQty": 0,
      "orderedQty": 3,
      "openQty": 3,
      "lotSerialNbr": "",
      "description": "Testvare 3",
      "orderLineNbr": 1
    }
  ],
  "shipmentOrderLines": [
    {
      "orderType": "SO",
      "orderNbr": "000004",
      "shippedQty": 0,
      "shippedWeight": 0,
      "shippedVolume": 0,
      "note": ""
    }
  ],
  "lastModifiedDateTime": "2021-02-04T11:22:24.373",
  "note": "",
  "metadata": {
    "totalCount": 1,
    "maxPageSize": 1000
  }
}

 

by Magnus Johnsen

How are you creating the shipment and adding the salesOrder?

Just so we can replicate the same workflow in our test. 

AllanEgebjerg
CONTRIBUTOR ***

by AllanEgebjerg

SalesOrder and Shipment is created manually from the Financials UI. Shipment is created from the Sales Order screen. 

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

We are not having any issues with this.

Steps taken:

1. Create Lot/Serial with "Assignment method": "Used"

2. Create item using lot class

3. Create salesOrder in UI with 3 of above item

4. Create shipment from salesOrder via UI (Shipped qty is at this point already 3)

5. PUT shipment:

{    "shipmentDetailLines": [{
        "operation": "Update",
        "lineNumber": {
            "Value": 1
        },
        "allocations": [{
         
            "operation": "Insert",
            "lineNbr": {
                "Value": 2
            },
            "quantity": {
                "Value": 1
            },
            "lotSerialNumber": {
            "value": "133"
          }
        },
        {
         
            "operation": "Insert",
            "lineNbr": {
                "Value": 3
            },
            "quantity": {
                "Value": 1
            },
            "lotSerialNumber": {
            "value": "134"
          }


        },
        {
         
            "operation": "Insert",
            "lineNbr": {
                "Value": 4
            },
            "quantity": {
                "Value": 1
            },
            "lotSerialNumber": {
            "value": "135"
          }


        }]
    }]
}
 
Result:
2021-02-04 14_08_48-Shipments.png
AllanEgebjerg
CONTRIBUTOR ***

by AllanEgebjerg

Ahh, now I see the error. 

It is called "lotSerialNbr" in "shipmentDetailLines", but "lotSerialNumber" in "allocations"

 

Thanks a lot 🙂

by Magnus Johnsen

What type of lot/serial class are you using? Could you please take a screenshot of the settings(ScreenId=IN2070PL)?

Are the allocation lines there before you're PUT?
Could you please send us the result of GET shipment as well and we'll have a look.