Web Services - GetVendorByKey example

This is a working code example for how to get a vendor in Dynamics GP 2010 Web Services. We use the getVendorByKey method to return a vendor object.

Related Articles

... and you 'll find more on the Web Services Menu

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

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences