How to: Configure Business Data Web Parts to Navigate ECT Associations

Overview

This how-to topic explains how to use Business Data Web Parts to navigate associations between external content types (ECTs).

Ff798406.note(en-us,PandP.10).gifNote:
Note: The how-totopic assumes that you have already created at least two ECTs and configured associations between them. For an explanation of how to configure associations between ECTs, see How to: Configure an Association Navigator by Using a Stored Procedure.
To use the Business Data Web Parts, you must be running Microsoft® SharePoint® Server 2010 Enterprise edition.

This how-to topic uses two associated ECTs—Vendors and VendorTransactions—to illustrate the process. These ECTs represent the corresponding tables in a vendor management database. The VendorTransactions ECT includes an association that links the VendorID column in the VendorTransactions table to the ID column in the Vendors table. The script required to create the database is contained in the following example.

CREATE TABLE [dbo].[Vendors](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NULL,
[Address] [varchar](50) NULL,
[City] [varchar](50) NULL,
[State] [varchar](50) NULL,
[ZipCode] [varchar](50) NULL,
[Country] [varchar](50) NULL,
[Telephone] [varchar](50) NULL,
[Industry] [varchar](50) NULL,
[AccountsPayable] [bigint] NULL,
 CONSTRAINT [PK_Clients] PRIMARY KEY CLUSTERED 
(
[Id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[VendorTransactions](
[ID] [int] IDENTITY(1,1) NOT NULL,
[VendorID] [int] NOT NULL,
[TransactionTypeId] [int] NOT NULL,
[Notes] [varchar](max) NULL,
[TransactionDate] [datetime] NULL,
[Amount] [money] NULL,
 CONSTRAINT [PK_ClientActivity] PRIMARY KEY CLUSTERED 
(
[ID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[VendorTransactions]  
   WITH CHECK ADD  CONSTRAINT [FK_VendorTransactions_Vendors] FOREIGN KEY([VendorID])
REFERENCES [dbo].[Vendors] ([Id])
GO
ALTER TABLE [dbo].[VendorTransactions] CHECK CONSTRAINT [FK_VendorTransactions_Vendors]
GO

Summary of Steps

This how-to topic includes the following steps:

  • Step 1: Configure a Business Data List Web Part. In this step, you add a Business Data List Web Part to a SharePoint page, and then configure it to display data from an ECT that contains an association definition.
  • Step 2: Configure a Business Data Related List Web Part. In this step, you add a Business Data Related List Web Part to a SharePoint page, and then configure it to display data from an ECT that contains an association definition.
  • Step 3: Connect the Business Data Web Parts. In this step, you connect the two Business Data Web Parts. This enables you to navigate the associated data.

Step 1: Configure a Business Data List Web Part

This procedure adds a Business Data List Web Part to a SharePoint page, and then configures it to display data from an ECT. This ECT should represent the parent entity in your association.

Ff798406.note(en-us,PandP.10).gifNote:
Note: Business Data Web Parts ship with SharePoint Server 2010 Enterprise edition.

To configure a Business Data List Web Part

  1. On a SharePoint Web Part page, on the Page tab in the ribbon, click Edit.
  2. Click in a rich content zone on the page, click the Insert tab on the ribbon, and then click Web Part, as shown in the following illustration.

    Ff798406.834fe219-75eb-42bb-a05e-8b3c77c09b71(en-us,PandP.10).png

  3. In the Categories list box, select Business Data, and then in the Web Parts list box, select Business Data List. After you make these selections, your page should resemble the following illustration.

    Ff798406.8cea4d99-17fe-42a3-b2b8-3abab42fb6bb(en-us,PandP.10).png

  4. Click Add.
  5. In the Business Data List Web Part, click Open the tool pane.
  6. In the tool pane, click the Select External Content Type button.

    Ff798406.d0ae6110-e4fc-4add-879e-ccf2de3b991f(en-us,PandP.10).png

  7. In the External Content Type Picker dialog box, select the ECT that represents the parent entity of the association. In this example, we selected the Vendors ECT.

    Ff798406.0910fa76-e7e3-4848-8318-0630caa86d9b(en-us,PandP.10).png

  8. Click OK.
  9. In the Web Part tool pane, click OK.
    Ff798406.note(en-us,PandP.10).gifNote:
    Steps 10-14 are optional. They configure the Web Part to improve the usability and presentation of the data.

  10. In the Business Data List Web Part, on the drop-down menu, click Edit Web Part, as shown in the following illustration.

    Ff798406.78927d91-b208-47bb-bb8b-ac96544b9606(en-us,PandP.10).png

  11. In the top right corner of the Web Part, click Edit View. (See the highlighted text in the following illustration.)

    Ff798406.a0aecf22-c524-43cb-9b92-09a613c6e268(en-us,PandP.10).png

  12. In the Columns section, select the columns that you want to display, as shown in the following illustration.

    Ff798406.bf630b9d-0495-4856-98b4-d138a4bfdfa0(en-us,PandP.10).png

  13. In the Pages section, choose how many items you want to display on a page. In the example, we indicated 5 items.

    Ff798406.3440a0dd-da05-4013-add9-1b8d3261c74b(en-us,PandP.10).png

  14. Click OK.

    The Business Data List Web Part is now configured. In this example, it displays vendor data from the data source associated with the Vendors ECT.

    Ff798406.6467b684-4900-4955-9517-69d1c4c9c57b(en-us,PandP.10).png

Step 2: Configure a Business Data Related List Web Part

This procedure adds a Business Data Related List Web Part to a SharePoint page, and then configures it to display data from an ECT. This ECT should represent the child entity in your association.

Ff798406.note(en-us,PandP.10).gifNote:
Note: Business Data Web Parts ship with SharePoint Server 2010 Enterprise edition.

To configure a Business Data Related List Web Part

  1. On your SharePoint Web Part page, on the Page tab in the ribbon, click Edit.
  2. Click below the Business Data List Web Part in the rich content zone on the page, and then on the Insert tab on the ribbon, click Web Part, as shown in the following illustration.

    Ff798406.7f31b953-10b0-4ec1-bba3-8cad87982222(en-us,PandP.10).png

  3. In the Categories list box, select Business Data, and then in the Web Parts list box, select Business Data Related List, as shown in the following illustration.

    Ff798406.b4b061fe-e10b-48ba-8d3f-b1d53235495f(en-us,PandP.10).png

  4. Click Add.
  5. In the Business Data Related List Web Part, click Open the tool pane.
  6. In the Web Part tool pane, click Select External Content Type.

    Ff798406.eb397140-3a3f-47fe-b0aa-698f829f0ae7(en-us,PandP.10).png

  7. In the External Content Type Picker dialog box, select the ECT that represents the child entity in your association. In this example, we selected the Vendor Transactions ECT.

    Ff798406.48453e45-a893-4f0d-95c8-0f45ee31d268(en-us,PandP.10).png

    Ff798406.note(en-us,PandP.10).gifNote:
    When you configure a Business Data Related List Web Part, the External Content Type Picker only displays ECTs that have associations defined for them.

  8. Click OK.
  9. In the Relationship drop-down list, select the relationship that the Business Data Related List Web Part should use to query and display associated data. See the following example.

    Ff798406.b3e86ed2-ca5e-4044-8283-c323c10e0763(en-us,PandP.10).png

  10. In the Web Part tool pane, click OK.
    Ff798406.note(en-us,PandP.10).gifNote:
    Steps 11-13 are optional. They configure the Web Part to improve the usability and presentation of the data.

  11. In the Business Data Related List Web Part, on the drop-down menu, click Edit Web Part.
  12. In the top right corner of the Web Part, click Edit View.
  13. In the Columns section, select the columns that you want to display, and then click OK. See the following example.

    Ff798406.4ed7ab63-c6e9-40e4-837e-1f18c0226eb3(en-us,PandP.10).png

    The Business Data Related List Web Part is now configured. However, you must connect the Web Parts before you can browse related data. The connection process is described in Step◦3.

    Ff798406.f2f85992-ec43-4cd4-8b33-09be1ca6751c(en-us,PandP.10).png

Step 3: Connect the Business Data Web Parts

This procedure connects the Business Data List Web Part to the Business Data Related List Web Part.

To connect the Business Data Web Parts

  1. In the BusinessData Related List Web Part, on the drop-down menu, select Edit Web Part.
  2. In the Business Data Related List Web Part, on the drop-down menu, point to Connections, point to Get Related Item From, and select the name of your Business Data List Web Part. In this example, our Business Data List Web Part is named Vendors List.

    Ff798406.1acaca9c-782d-4183-aab0-2376fb6ed4b7(en-us,PandP.10).png

    The page refreshes and the Web Parts indicate that they are connected, as shown in the following illustration.

    Ff798406.088233ae-03d3-4353-b187-4a54a2218029(en-us,PandP.10).png

  3. In the Web Part tool pane, click OK.
  4. In the Business Data List Web Part, click the diagonal arrow next to a row of data, as shown in the following illustration.

    Ff798406.d19ac6c0-aa20-4f49-b62c-12ebef508c72(en-us,PandP.10).png

    Notice that the page refreshes and the Business Data Related List Web Part displays the associated data for the selected item, as shown in the following illustration.

    Ff798406.bfb35956-b1e7-4db5-ab3c-a2bbb4a9713d(en-us,PandP.10).png

Show: