My Products
Help
Florian Haase
PARTNER

Registering of serialnumber by API not working any more

by Florian Haase

Hi,

 

we have som trouble here. We made a api-integration for registering av serialnumber on PurchaseReceipts. The customer has not used this for a while but there was not any code changes. Now they want to use it again but it does not work any more.

 

Following details:

CompanyId=2350700

PurchaseReceiptNo=2000182

 

Json:


{"lines":[{"allocations":[{"operation":"Insert","lineNbr":{"value":1},"lotSerialNumber":{"value":"8105"},"quantity":{"value":1.0}}],"operation":"Update","lineNbr":{"value":1}}],"receiptType":{"value":"PoReceipt"},"receiptNbr":{"value":"2000182"}}

 

(originally we have here a list of 60 serial numbers, but for testing purposes we have reduced it to one - and we get the same errormessage)

 

Error from API:

skjermbilde.PNG

 

Doing the same in UI works perfectly:

skjermbilde2.PNG

 

We also tried to send the location (which is chosen in UI automatically) in the Json but that did not help - we get the same error-message.

 

We know that this worked before, but we don't know exactly now it stopped.

 

This could be difficult to test for us because the customer has to send the articles. They have to register the serialnumbers in the UI just now because they can't wait for a solution here.

 

Any ideas?

 

Regards,

 

Florian

6 REPLIES 6

by Magnus Johnsen

What settings does the item have for serial/lot?

Are you sure you are applying a new serial and location for each item?

 

Please also try to not send lineNumber 1 on both operations, even though lineNumber on insert operation has earlier been ignored, there might be significance to the same line first being inserted, although it already exists on the receipt and then being updated. 

Florian Haase
PARTNER

by Florian Haase

Hei,

 

following setup is done:

skjermbilde.PNG

Yes we are sure that the serial-number is not registered at this location before - i guess that was that you thought about?

 

We deleted the line-number on the insert of the allocation but we get still the same error. We also tried to register a new inventory-Item without a "-" in the inventory-number and copied the setup from the existing item. But it resultet just in the same error-message. We also tried on several other lines on the same receipt - still the same error.

 

The linenumber on the update we can't delete - this is the reference which line we want to update.

 

I have no idea whats wrong here...

 

FLorian

 

Florian Haase
PARTNER

by Florian Haase

Hi

 

where you able to reproduce that? 

 

Florian

by Magnus Johnsen

Hi, we're looking at it and we'll get back to you soon.

by Magnus Johnsen

Hi,

 

We are not able to reproduce this.

 

First, we created a purchaseOrder with 2 items in the UI, from this a purchaseReceipt was created. 

Before updating, no allocations has been made automatically:

2020-10-20 10_09_36-Purchase receipts.png

 

We then try to update it with just 1 allocation line and receive the error:

2020-10-20 10_14_38-Postman.png

 

When sending both allocations that are needed, the PUT goes through and both lines are allocated:

2020-10-20 10_15_09-Purchase receipts.png

 

Please make sure there are no other items in the receipt that needs to be added, please make a get request and review the response to see if there are other lines that have been used. You can send us the response in a file and we can have a look at it as well.

 

Florian Haase
PARTNER

by Florian Haase

Hi,

 

now I spent over 1 hour for testing this and you are right. As far as the receipt quantity on all lines is the same as the number of serialnumbers we try to read than this works. 

 

This is also the cause why it worked before but not in this special case. In the actual receipt we had to lines with serialnumber-items but the files with the serial number we get for each inventory-number. So far we always had just 1 line with a serial-item.

 

BUT: The behavior in the API is not the same as in the UserInterface. As far as the Receipt is on hold its fully possible to add serialnumbers so many as you want and on the lines as you want. Its just not possible to change the Status to balanced if you not have registered all serialnumbers. This is also a bug in the API. It does not help either to explicitly send hold = true once again with the PurchaseReceiptUpdateDto. Nice if development could fix this because otherwise we have to copy and paste the files with the serialnumbers together to 1 file. 

 

Florian