Acumatica采购订单收据API找不到采购订单Nbr

时间:2020-08-04 17:07:22

标签: acumatica

我正在尝试使用采购订单上的明细行项目创建采购收据。当我使用API​​进行此操作时,我收到一条错误消息,说在系统中找不到PO。如果我不引用订单,则可以添加订单项,但是只要引用订单API错误,我就可以添加订单项。采购订单号有效,且项目在采购订单上。

我可以在Acumatica中手动完成此操作,并且没有问题,并且PO实际可用,就像所说的手动执行没有问题。

这是我正在执行的简单JSON请求。

{
    "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"}
           
        }
    ]
}

这是我收到的错误:

 "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 个答案:

答案 0 :(得分:1)

尝试一下:

{
"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"}
       
    }]
}

您传递了错误的订单类型,这就是为什么它找不到采购订单的原因。如果CreateBill = true,则还需要供应商参考。