Understanding Microsoft Dynamics NAV Web Part Connections
The Microsoft Dynamics NAV Web Part is derived from a Microsoft SharePoint Web Part, which is built on the ASP.NET Web Parts control set. Microsoft Dynamics NAV Web Parts communicate with other Web Parts using ASP.NET Web Parts connections. A Web Parts connection is a link between two server controls that enables two Web Parts to share data. For a specified connection, one control functions as the provider of data, and the other control functions as the consumer of the data from the provider.
Web Parts connections are based on a pull model of connectivity, where the consumer gets data from the provider. When connecting a Microsoft Dynamics NAV Web Part, the Microsoft Dynamics NAV Web Part can function as a provider or consumer of data, as shown in the following illustration.
For more information about ASP.NET Web Parts and connections, see Web Part Infrastructure in SharePoint Foundation, Web Parts Control Set Overview, and Web Parts Connections Overview in the MSDN Library.
Providing Data
As a provider, the Microsoft Dynamics NAV Web Part implements the IWebPartRow interface to pass a row of data to the consumer Web Part. The row data is extracted from the table associated with the page that is displayed in the Web Part. The row data includes values for all enabled fields in the database table, which also includes values that are defined by the SourceExpr Property.
Consuming Data
As a consumer, a Microsoft Dynamics NAV Web Part connects to the provider by using the IWebPartParameters interface. This allows a provider that implements either the IWebPartRow interface or the ITransformableFilterValues interface to pass a filter value to the consumer. The consumer accepts what it recognizes as filterable data, such as a field value from a data row.
The ITransformableFilterValues interface lets you connect a Microsoft Dynamics NAV Web Part to a SharePoint Filter Web Part. A SharePoint Filter Web Part provides a user interface that you can use to enter search or filter criteria for a data query on a table or list. SharePoint Filter Web Parts implement the ITransformableFilterValues interface. A Microsoft Dynamics NAV Web Part can connect to SharePoint Filter Web Part because a transformer class binds the IWebPartParameters (consumer) and ITransformableFilterValues (provider) connection points.
Note
By default, Microsoft SharePoint Server 2010 includes several filter Web Parts.
Transforming Data for Incompatible Connection Points
In a Web Part connection, the consumer and provider must have compatible connection points. Connection points are incompatible when they provide or consume data through different interfaces. For example, a provider that implements the IWebPartRow interface cannot connect to a consumer that implements the IWebPartParameters interface.
To handle data communication between two Web Parts controls with incompatible connection points, you implement a Web Part transformer. Web part transformers are based on the WebPartTransformer class. For example, when you connect two Microsoft Dynamics NAV Web Parts, the RowToParametersTransformer object transforms data from the provider to the consumer. The transformer provides a user interface that lets the user configure the connection during setup. The following illustration shows an example of a connection dialog box.
Transformers Supported by Microsoft SharePoint
The following table lists the transformers that are supported by SharePoint for provider and consumer interfaces. Microsoft SharePoint supports transformers that are part of the Microsoft .NET Framework 4.0 (ASP.NET) class library and the Microsoft SharePoint 2010 class library.
Provider interface | Consumer interface | WebPartTransformer-based class |
---|---|---|
IWebPartRow |
IWebPartField |
.NET Framework: RowToFieldTransformer |
IWebPartRow |
IWebPartParameters |
.NET Framework: RowToParametersTransformer SharePoint: SPRowToParametersTransformer |
ITransformableFilterValues |
IWebPartField |
SharePoint: TransformableFilterValuesToFieldTransformer |
ITransformableFilterValues |
IFilterValues |
SharePoint: TransformableFilterValuesToFilterValuesTransformer |
ITransformableFilterValues |
IWebPartParameters |
SharePoint: TransformableFilterValuesToParametersTransformer |
See Also
Tasks
How to: Display a Microsoft Dynamics NAV Page in a Web Part
How to: Connect a Microsoft Dynamics NAV Web Part
Walkthrough: Connecting a Microsoft Dynamics NAV List Page to a Document Library
Concepts
Connecting Microsoft Dynamics NAV Web Parts to Other Web Parts
Understanding Microsoft Dynamics NAV Web Part Connections
Filtering Data on a Microsoft Dynamics NAV Page