问题
I am trying to create a Purchase Receipt with a detail line item that is on a Purchase Order. When I do this with the API, I get an error back saying that the PO could not be found in the system. I can add line items fine if I do not reference the PO, but as soon as I reference the PO the API errors. The PO number is valid and the item is on the PO.
I can do this manually in Acumatica with no problem and the PO is in fact available and like a said doing it manually has no problems.
Here is the simple JSON request I am making.
{
"CreateBill": {"value": true},
"VendorID": {"value": "ARTISTICCARP"},
"Details": [
{
"InventoryID": {"value":"VND1807 4x6"},
"ReceiptQty": {"value": 1},
"POOrderNbr": {"value": "001131" },
"POLineNbr": {"value": 1},
"POOrderType": {"value": "Goods for IN"}
}
]
}
This is the error I am receiving:
"innerException": {
"message": "An error has occurred.",
"exceptionMessage": "OrderNbr=Order Nbr. '001131' cannot be found in the system.",
"exceptionType": "PX.Data.PXException",
"stackTrace": " at PX.Objects.DefaultEndpointImpl.PurchaseReceiptDetail_Insert(PXGraph graph, EntityImpl entity, EntityImpl targetEntity)"
}
回答1:
Try this :
{
"CreateBill": {"value": true},
"VendorRef": {"value": "FROM_API"},
"VendorID": {"value": "ARTISTICCARP"},
"Details": [
{
"InventoryID": {"value":"VND1807 4x6"},
"ReceiptQty": {"value": 1},
"POOrderNbr": {"value": "001131" },
"POLineNbr": {"value": 1},
"POOrderType": {"value": "Normal"}
}]
}
You passed in a wrong order type that's why it cannot find the purchase order. And you also need a Vendor Ref if CreateBill = true.
来源:https://stackoverflow.com/questions/63251817/acumatica-purchase-order-receipt-api-can-not-find-po-order-nbr