在Dynamics GP中创建采购订单

时间:2011-08-25 18:14:16

标签: vb.net dynamics-gp

我的主要问题是使用网络服务创建采购订单需要哪些字段。我一直有异常,所以我觉得我要留下一些信息。有任何想法吗?这是我的代码:

Public Sub CreatePurchaseOrder(ByVal shipToAddress As BusinessAddress,
                               ByVal billToAddressKey As AddressKey,
                               ByVal purchaseOrderLines As PurchaseOrderLine(),
                               ByVal venKey As VendorKey,
                               ByVal venName As String,
                               ByVal poDate As Date,
                               ByVal custKey As CustomerKey)
    Dim po As PurchaseOrder = New PurchaseOrder
    po.BillToAddressKey = billToAddressKey
    po.Lines = purchaseOrderLines
    po.ShipToAddress = shipToAddress
    po.VendorKey = venKey
    po.VendorName = venName
    po.Date = poDate
    po.CustomerKey = custKey
    po.Type = PurchaseOrderType.Standard



    Dim cxt As Context = getContext()
    Dim poPol = wsDynamicsGP.GetPolicyByOperation("CreatePurchaseOrder", cxt)
    wsDynamicsGP.CreatePurchaseOrder(po, cxt, poPol)
End Sub

1 个答案:

答案 0 :(得分:0)

要实际创建它,您只需要一个带有Id的供应商密钥和一个带有Id的购买密钥