to get a personalized navigation.
to get a personalized navigation.
Hi
When placing NonStock items on purchaseReceipts the following error occurs:
{
"message": "Error creating 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"
}
This works well in the GUI, but when adding to purchaseReceipts "manually" this error occurs.
Please see the attached json file as example.
Solved! Go to Solution.
Don't think so. Hopefully this will be resolved in the new v2 endpoint for purchaseReceipt POST planned to be released in Q1.
This problem was repported a year ago in the old forum but never resolved. In the old post it is also stated the following from your (Visma) side: "In further testing, we can see that even when using "actions" to link the documents, trying to update the line returns "Account cannot be empty" even when included."
For multiple reasons using actions to create PurchaseReceipts is not an acceptable solution.
Please reopen the issue (if closed) to get this fixed through the normal /controller/api/v1/PurchaseReceipt POST endpoint and give us a status on when we can expect this to work. Our customers are getting pretty impatient about all the flaws in creating PurchaseReceipts through the API.
Hello, this has been conveyed to the development team when the mentioned issue arisen. The case is still open, we've once again emphasized that Transaction sent via Purchase Receipt Endpoint should be able to make correct linkage between Order <> Receipt and able to add Purchase Order Line/s containing non-stock items.
Currently, we don't have information about when & how this will be fixed. We're following that, and we will provide further updates when we receive.
Thanks.
Hello,
Please use the following endpoint for adding Purchase Order Lines to the Purchase Receipt after creating an empty receipt.
Purchase Receipt <https://integration.visma.net/API-index/>
{
"purchaseOrderLines": [
{
"orderNbr": "000006",
"lines": [
{
"lineNbr": "1"
},
{
"lineNbr": "2"
},
{
"lineNbr": "3"
}
]
},
{
"orderNbr": "000007",
"lines": [
{
"lineNbr": "1"
}
]
}
]
}
Please see this thread https://community.visma.com/t5/Forum-in-Developers-Visma-net/addPurchaseOrderLines-and-purchaserecei... where you recommend NOT to do it that way due to addPurchaseOrderLines having faults when dealing with serial numbers.
It's related to that case since we receive data with both serial numbers and also with nonstock items. Please advise.
Unfortunately, in this case, this is not possible to complete the described transaction. Adding PO lines within Purchase Receipt Endpoint, that operation would not work with Stock-Item as its reported here (Also would cause data connection issues in the UI), therefore, specifically exposed endpoint needs to be used.
poReceiptUpdateDto > Model
Consequently, this case should be resolved before the desired operation can be handled via the API: addPurchaseOrderLines and purchasereceipts with serial no
When i use "addPurchaseOrderLines" for Non-stock items and subsequently PUT an update for receiptQty on the lines, the same error as in the thread start appear. So i find it impossible to use the purchaseReceipt endpoints for non-stock items. Is that correct, or im I missing something?
We're able to add a Purchase Order Line with a non-stock item to the Purchase Receipt.
1) POST - Purchase Receipt > https://integration.visma.net/API/controller/api/v1/PurchaseReceipt
{
"receiptType": {
"value": "PoReceipt"
},
"supplierId": {
"value": "00005" <Replace with your data>
},
"date": {
"value": "2021-07-12"
}
}
2) POST > .../api/v1/PurchaseReceipt/000079/action/addpurchaseorderlines
{
"purchaseOrderLines": [
{
"orderNbr": "000132", <Replace with your data>
"lines": [
{
"lineNbr": "1"
}
]
}
]
}
Reference "Purchase Order":
Make sure, used non-stock item's "Require Receipt" flag is checked and Purchase Order Line > Account has a value.
Financials UI- Purchase Receipt
Yes, original ReceiptQTY was 5 (As defined in the linked Purchase Order Line <orderQty>)
PUT > .../controller/api/v1/PurchaseReceipt/000079
{
"ReceiptType": {
"value": "PoReceipt"
},
"lines": [
{
"operation": "Update",
"lineNbr": {
"value": 1
},
"transactionDescription": {
"value": "UpdateReceiptQTY"
},
"receiptQty": {
"value": 7
}
}
]
}
Linked Purchase Order Line's ReceiptQty has also been updated accordingly.
Magic 🙂 This is exactly what i have been testing, but i get the 'Account' cannot be empty error instead. Ill make new tests tomorrow to figure out what im doing wrong.
Thanks for the help 🙂
Hei Erik, no problem 🙂 Might be related to the Non-stock item's properties so if you could share the details of the Purchase Order / Receipt and the Inventory via developersupport@visma.com after testing then we can check this out together again. Cheers !
Copyright © 2022 Visma.com. All rights reserved.