How objects can be extended

All classes in the Dynamics GP service that inherit from the BusinessObject class can be extended through a data extension mechanism and a collection of events. The standard business documents in Microsoft Dynamics GP, such as customers, vendors, sales documents, and so on that inherit from BusinessObject can all be extended.

Typically, Dynamics GP web service objects are extended to support storing and retrieving additional data that is related to the object. For instance, the InventoryItem object could be extended to store additional data for the item. Dynamics GP service objects can also be extended for other purposes, such as adding additional data validation.

The ExtensionList collection for each business object contains the extensions (additional data) that is being passed along with the object. Each extension in the collection has the following:

ExtensionId   A string that identifies the extension. This typically describes what type of data the extension contains.

DocExtension   An XML element that contains the additional data being passed with the object.

When an application uses a Dynamics GP service object that has been extended, the application is responsible for processing the XML element for each extension added to the object. It must process the XML element to extract the additional data when the object is retrieved. It must also create the properly-formed XML element for each extension when an object is being created or updated. Refer to Using Service Extensions for detailed examples of how web service consumers will access extensions.