Imports WebServicesGP2010.ServiceReference1
Imports System.ServiceModel
Public Class GetAVendor
Sub GetVendorByKey()
Dim companyKey As CompanyKey
Dim context As Context
' Create an instance of the service
Dim wsDynamicsGP As DynamicsGPClient = New DynamicsGPClient
' Create a context with which to call the service
context = New Context
' Specify which company to use (sample company)
companyKey = New CompanyKey
companyKey.Id = -1
' Set up the context object
context.OrganizationKey = CType(companyKey, OrganizationKey)
Dim vendor As Vendor
Dim vendorKey As VendorKey
'Create a vendor key
VendorKey = New VendorKey()
VendorKey.Id = "ACETRAVE0001"
'Display vendor name
MessageBox.Show("Vendor: " + Vendor.Name)
End Sub
End Class