Applications expose their functionality to VBA through a set of programmable objects. These objects include windows, reports, grids and Dynamic User Object Store (DUOS) objects. The relationship each object has to another object is expressed in a hierarchical object model, shown in the following illustration:
The organization of the model is important, since you must navigate through the object model within VBA code to access lower-level objects. For example, to access a window field, you must first indicate the field’s window object:
'Set a field on a window CustomerMaintenance.CustomerID.Value = "AARONFIT0001"
The following sections explains each object in more detail.
Most of the VBA programming you’ll complete for windows will involve the following objects.
Object |
Description |
---|---|
Window |
Represents an open window. |
Window field |
Represents a field in a window. |
Refer to Programming Windows and Programming Window Fields for more information about using VBA with windows.
Grids are VBA’s definition of a scrolling window. When working with grids, you’ll use the following objects:
Object |
Description |
---|---|
Grid |
Represents a grid (scrolling window) in an open window. |
Window field |
Represents a field in a grid. |
Refer to Programming Grids for more information about using VBA with grids, and Programming Window Fields for information about programming window fields within a grid.
When working with reports, you’ll use the following objects:
Object |
Description |
---|---|
Report |
Represents a report. |
Report field |
Represents a field in a report. |
Refer to Programming Reports for more information about using VBA with reports.
When implementing a VBA integration, you may need to retrieve information about the user currently logged into Microsoft Dynamics GP. The UserInfo object provides access to this information. Refer to UserInfo Object for more information about retrieving user information.
The Dynamic User Object Store (DUOS) allows you to store and display user-definable data.
Object/Collection |
Description |
---|---|
DUOSObjects collection |
Contains all user-definable data objects. |
DUOSObject object |
Represents a single data object. |
DUOSProperties collection |
Contains all properties for a data object. |
DUOSProperty object |
Represents a single property for a data object. |
Refer to Storing Additional Data for more information about using VBA with the DUOS.