在 Dynamics GP 中创建采购订单

发布于 2024-12-01 05:17:16 字数 1033 浏览 3 评论 0原文

我的主要问题是使用 Web 服务创建 PO 需要哪些字段。我不断遇到异常,所以我觉得我遗漏了一些信息。有什么想法吗?这是我的代码:

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

My main question is what fields are required for creating a PO using the web services. I keep getting an exception, so I feel like im leaving some info out. Any ideas? Here is my code:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

握住你手 2024-12-08 05:17:16

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

To actually create it, all you need is a vendor key with an Id and an Purchase Key with an Id

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文