Acumatica Purchase Order Receipt API Can not find PO Order Nbr

本秂侑毒 提交于 2021-02-11 17:10:36

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!