在 Dynamics GP 中创建采购订单
我的主要问题是使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要实际创建它,您需要的只是一个带有 Id 的供应商密钥和一个带有 Id 的购买密钥
To actually create it, all you need is a vendor key with an Id and an Purchase Key with an Id