Compartilhar via


Dynamics GP service use for Update Customers

The sample application uses several Dynamics GP service objects and methods. The WebServiceManager class loads a proxy class named wsDynamicsGP that allows service objects and methods to be used. The application loads the wsDynamicsGP proxy class using information provided by the service.

Methods

The WebServiceManager class constructor loads the services proxy and creates a context object.

The GetCompanyList method retrieves the list of all available companies. The method uses a CompanyCriteria object along with a BetweenRestrictionOfNullableOfint restriction object to retrieve a list of company summary objects.

The GetCustomerList method retrieves a list of customers for a specified company. The company is designated by setting the OrganizationKey property of the Context object. The method uses a CustomerCriteria object and a LikeRestrictionOfstring object to retrieve the list of customer summary objects.

The GetCustomerByKey method retrieves a single customer object. The Id property of the CustomerKey object is used to specify the customer to retrieve.

A customer object and customer key object identify the customer to be updated. The contents of the user interface Comment textbox populates the customer object Comment1 property. The UpdateCustomer method saves the updated customer object to the database.