to get a personalized navigation.
to get a personalized navigation.
Hei,
I try to update POReceipts. That means that I try to delete the existing lines and insert the updated ones. (I do this because delete endpoint is missing):
But I cant get this work:
Insert of new lines works perfectly:
{"lines":[{"operation":"Insert","inventoryId":{"value":"1150"},"transactionDescription":{"value":"Glass og metall fra Næring#Veieseddel: 306650 - dato: 30.09.2020"},"receiptQty":{"value":7.68}}],"receiptType":{"value":"PoReceipt"},"receiptNbr":{"value":"306650"},"hold":{"value":false},"date":{"value":"2020-09-30T09:14:14.117+02:00"},"createBill":{"value":false},"supplierRef":{"value":"bh"}}
The same json just with the delete:
{"lines":[{"operation":"Delete","lineNbr":{"value":1}},{"operation":"Insert","inventoryId":{"value":"1150"},"transactionDescription":{"value":"Glass og metall fra Næring#Veieseddel: 306650 - dato: 30.09.2020"},"receiptQty":{"value":7.68}}],"receiptType":{"value":"PoReceipt"},"receiptNbr":{"value":"306650"},"hold":{"value":false},"date":{"value":"2020-09-30T09:14:14.117+02:00"},"createBill":{"value":false},"supplierRef":{"value":"bh"}}
results in:
Error updating purchase receipt. Error: Inserting 'Purchase receipt line' record raised at least one error. Please review the errors.\\r\\nError: 'Account' cannot be empty.\\r\\nError: 'Sub. ID' cannot be empty.\\r\\n\
Regards
Florian
I tried also to set the same information on the delete lines as on the insert lines but I get still the same error-message.
Florian
Is this poReceipt linked to an order?
And the line that you want to delete, is it the only line in the receipt?
Does this happen when you send the delete by itself as well, or only when you delete one line and add another?
Hei,
Line is not connected to anything since we directly import to POReceipts. These receipts are balanced but don't have any connection. They are also marked as no-billing. I have checked - it's not a problem to delete these lines in the UI. It does not seem like the number of lines does matter either. I get the same error if there are three or one lines in the receipts. I did not try to just send the delete (I think that it would not be possible to save an empty receipt without lines)
Florian
Alright, could you please send us an example of what you would include in your initial post, and then the put for your request, you can attach this as a text file.
We'll have a look and test this according to your scenario.
Thank you.
I sent a email with the Json strings
Florian
Thank you, we'll have a look and get back to you.
Hi Magnus,
whats the status here?
We got around this by first placing a new line and than delete the old lines instead for first deleting the old lines and than placing the new lines.
But now I got completely stock: Our customer wants to change the SupplierId by the API. And that its only possible in the UI when I delete all lines first. How can I handle this? There is missing the DELETE endpoint on the POReceipt and I can't delete the lines either - so its not possible to change the supplier in any way I see.
Any suggestions?
Florian
I just wonder if I have really tried to only delete all lines without inserting at the same time. I test this now. This is getting to give many API calls for just 1 update of an POReceipt, but maybe the only solution...
Hi,
ok, I am actually able to delete all lines if I set the POReceipt on hold at the same time.
But now I meet the next problem:
{ "message": "Error updating purchase receipt. Update of receipt supplier is not allowed." }
JSon:
{
"supplierId":{"value":40480}
}
That's no problem in the UI so far the POREceipt is on hold and has no lines.
Can you confirm this as a bug? We have a status meeting with the customer tomorrow, would be nice to have at least a answer...
Florian
Hello Florian,
As long as Purchase Receipt has no lines & not released, its "SupplierID" can be updated and this should also be viable through the API > PUT request. We confirm the bug, unfortunately, the operation returns the aforementioned error. This has now been conveyed to the development team.
OK,
thanks for confirming,
than I know that we have to get around this in another way. Just now we delete all lines set it on hold and leave it and generate a new running number on the same main number. A lot of coding, but will probably work good enough.
Would be so much more easier if we just could delete the POReceipts through the API.... 🙂
Florian
We've also escalated, exposing Delete Operation under Purchase Receipt endpoint as a new idea for the development team's review : Expose Delete operation via Purchase Receipt Endpoint
We're sorry for that the issue put additional workload in the integration. We'll inform you about the bug fix progress.
Thank you,
great!
Copyright © 2022 Visma.com. All rights reserved.