ENTERPRISE

Business Intelligence in SharePoint 2010 with Business Connectivity Services : External Content Types (part 3) - Creating an External Content Type for a Related Item

2/11/2011 9:09:41 AM

Creating an External Content Type for a Related Item

Most normalized databases have several tables with relationships to other tables, which are models for real-world information. A customer, for example, can place one or more orders with a company. An order can contain one or more products, and a single order may be delivered in one or more shipments.

A normalized database, to accurately model this information, can define relationships between these tables. A one-to-many relationship would exist between a Customers table and an Orders table. Both tables would contain a CustomerID field. In the Customers table, each individual record would have a unique CustomerID. In the Orders table, there might be several records with the same CustomerID. This represents that one customer has placed multiple orders.

The AdventureWorksLT database contains this exact relationship between the Customers and Orders tables. With Business Data Connectivity, there is an extra step involved with defining an External Content Type with this type of relationship.

The following steps address how to create an External Content Type for Orders, where a relationship to another content type exists:

1.
In SharePoint Designer, in the Site Objects pane on the left side, click the External Content Types option.

2.
In the External Content Types Ribbon, click the New External Content Type button.

3.
In the External Content Type Information, type BCS Order for both the Name and the Display Name.

4.
In the External System field, click the Click Here to Discover External Data Sources and Define External Content Types link.

5.
The AdventureWorksLT data source should already be available from having completed the previous set of steps. Expand the AdventureWorksLT node and the Tables node. Expand the SalesOrderHeader node and the Columns node to view the columns in the SalesOrderHeader table. Notice the CustomerID column.

6.
Right-click SalesOrderHeader, and select New Read Item Operation.

7.
In the first part of the Read Item Wizard—Operation Properties—type Sales Order Read Item as both the Operation Name and the Operation Display Name. Click Next.

8.
As with the CustomerID field for the Customer external content type, the SalesOrderID field is automatically recognized as the identifier for the external content type. No changes are necessary on this screen. Click Next.

9.
The last portion of the wizard—Return Parameters—defines which columns from the database will be available for consumption. No changes are necessary on this screen. Click Finish.

10.
Next, right-click on SalesOrderHeader, and select New Association. This is the operation necessary to establish the relationship between a customer and an order.

11.
The Association Creation Wizard is divided into four sections, as shown in Figure 4. In the first, Association Properties, type SalesOrder Customer Association as both the Name and the Display Name.

Figure 4. Create an association between related external content types.

12.
Next to Related External Content Type, click the Browse button. The BCS Order (the current one) and BCS Customer (created earlier) external content types should both be available. Select BCS Customer and click OK. Below, the field CustomerID is automatically selected because both tables have the field with the same name. Thus SharePoint Designer recognizes that this is the likely field on which to establish the relationship. Click Next.

13.
In the second part of the wizard—Input Parameters—click the CustomerID field under Data Source Elements. Then check the box to the right labeled Map to Identifier and click Next.

14.
In the Filter Parameters section, no changes are necessary. Click Next.

15.
In the Return Parameters section, no changes are necessary. Click Finish.

16.
In the Data Source Explorer of SharePoint Designer, right-click the SalesOrderHeader table and select New Read List Operation.

17.
In the Operation Properties portion of the wizard, type SalesOrder Read List as the Operation Name and the Operation Display Name. Click Next.

18.
In the Filter Parameters section, click Add Filter Parameter. In the Properties section for the new filter, change the Data Source Element to CustomerID. For the Filter parameter, click the Click to Add link. Make no changes in the Filter Configuration dialog box, and click OK. For the Default Value property, enter 1. Click Next.

19.
In the Return Parameters section, select SalesOrderID field in the Data Source Elements section, and select the box in the Properties section labeled Show in Picker. Repeat this for the OrderDate, ShipDate, and TotalDue fields. Click Finish.

20.
Click the Save icon in the upper-left corner of SharePoint Designer (or use the Ctrl-S keys) to save the External Content Type.

At this point, there are now two external content types in the BCS Metadata Store in SharePoint central administration. These external content types are now available for use in the SharePoint sites.

Other  
  •  Recovering from a Disaster in an Exchange Server 2010 Environment : Recovering from Database Corruption
  •  Recovering from a Disaster in an Exchange Server 2010 Environment : Recovering Exchange Server Application and Exchange Server Data
  •  Recovering from a Disaster in an Exchange Server 2010 Environment : Recovering from a Complete Server Failure
  •  Sharepoint 2007: Add a Column to a List or Document Library
  •  Sharepoint 2007: Create a New Document Library
  •  Sharepoint 2007: Open the Create Page for Lists and Libraries
  •  Exchange Server 2010 : Developments in High Availability (part 3) : Backup and restore
  •  Exchange Server 2010 : Developments in High Availability (part 2) : Configuring a Database Availability Group & Managing database copies
  •  Exchange Server 2010 : Developments in High Availability (part 1) : Exchange database replication & Database Availability Group and Continuous Replication
  •  High Availability in Exchange Server 2010 : Exchange Server database technologies
  •  SharePoint 2010 : Cataloging the Best Scripts to Automate SharePoint Administration
  •  SharePoint Administration with PowerShell (part 2)
  •  SharePoint Administration with PowerShell (part 1)
  •  Sharepoint 2007: Approve or Reject a File or List Item
  •  Exchange Server 2007 : Configure the Client Access Server - Enable POP3 and IMAP4
  •  Exchange Server 2007 : Configure the Client Access Server - Enable and Configure Outlook Anywhere
  •  Exchange Server 2007 : Configure the Client Access Server - Create and Apply ActiveSync Mailbox Policies
  •  SharePoint 2010 : Understanding Windows PowerShell Concepts (part 3)
  •  SharePoint 2010 : Understanding Windows PowerShell Concepts (part 2)
  •  SharePoint 2010 : Understanding Windows PowerShell Concepts (part 1)
  •  
    Top 10
    Qooq - The First Culinary Tablet Made For The Kitchen
    HP Envy 23 TouchSmart - All-in-One Desktop PC
    Kobo Aura HD - An Excellent Ebook Reader
    Razer Edge Pro - It Combines Tablet, Laptop And Gaming PC In One
    Samsung Galaxy S4 Review (Part 8)
    Samsung Galaxy S4 Review (Part 7)
    Samsung Galaxy S4 Review (Part 6)
    Samsung Galaxy S4 Review (Part 5)
    Samsung Galaxy S4 Review (Part 4)
    Samsung Galaxy S4 Review (Part 3)
    Most View
    Canon EOS M – Is The Final Big Player?
    Windows 7 : Networking and HomeGroup Sharing - Sharing Between PCs (part 1) - HomeGroup Sharing
    KWA 150 SE – The Most Expensive Amplifier Of ModWright
    MSI FM2-A85XA-G65 Motherboard Review (Part 1)
    Nikon D600 Digital SLR Camera - Full-Framed Temptress
    Tips & Tricks Of November 2012 (Part 1)
    Popular GPS Apps Shootout (Part 1)
    Cambridge Audio Azur 751R - The Importance Of Being Earnest (Part 1)
    Google vs Apple vs Microsoft (Part 5)
    Roll Your Own Home Server (Part 1)