Using an External Data Column
We already have our Customer data in its own list in
SharePoint, but what if we wanted to use just one of those columns in a
different list? Using a new column type called an External Data Column,
we can achieve just that.
In our site we have a document library that we have
been using for tracking customer forms such as invoices, presentations,
and so on. Rather than using a choice column for the customer
reference, we can pull this value directly from our enterprise customer
list using the external Content Type we created earlier.
Figure 1
shows us adding a new column to our customer documents library. We
select the External Data as the Column type, and then we configure that
to use the Northwind Customers External Content Type which allows us to
select a value from the CustomerID column. That’s all there is to it.
Now when we pick a customer ID we know it is the correct value.
Building a Composite Application
So far we have built an External Content Type and
used that to create an external list in our SharePoint site and also to
create an External Data Column in our documents library. With all that
done, we have enough to build a simple composite application.
The BCS provides several Web Parts that we can now
use to build a composite application. Out of the box, we get the Web
Parts listed in Table 1.
Table 1. Several Web Parts Provided by the BCS to Use to Build a Composite Application
Web Part | Description |
---|
Business Data Actions | Displays a list of actions from an External Content Type |
Business Data Item | Displays a single item from an External Content Type |
Business Data Item Builder | Uses the query string to create a business data item and provides the value to other Web Parts |
Business Data List | Displays a list of items from the External Content Type |
Business Data Related List | Displays a list of items related to one or more parent items from an External Content Type |
Business Data Connectivity Filter | Uses values from the External Content Type to use to filter the contents of Web Parts |
So let’s build a composite application for our
customers from Northwind. Our application will contain a filter where
we pick our customer, and then the filter will be applied to a data
item Web Part and a document library Web Part.
Note
The
Business Data Web Parts are part of the Enterprise license; to access
them you must activate the Enterprise Site Collection Features through
Site Settings.
After creating a new page in our site, we edit the page to add our Web Parts as seen in Figure 2. All of the BCS Web Parts are in the Business Data folder in the Web Part navigator.
We are going to add the following Web Parts to our
page: the Business Data Connectivity Filter, the Business Data Item,
and then the Shared Documents list (for this we select from Existing
List in the ribbon).
When we have our three Web Parts added to the page,
we are going to connect the business data Web Parts to our Customers
External Content Type and then configure them all to talk to each
other. The Business Data Web Parts are easily connected to the External
Content Type using the Web Part properties. Once we have those
configured, we use Web Part connections to wire them together. Figure 3 shows how to connect the Web Parts. For our connections, the Business Data Connectivity is the provider(providing
the customer ID to the other Web Parts), with the shared documents
library and Business Data Item Web Parts being the consumers.
With our connections
configured, selecting a customer from the filter Web Part using the
little icon to the right displays the customer details in the Business
Data Item Web Part and will then filter the Shared Documents Web Part
for just those customer documents. Figure 4 shows us what our application looks like after a customer has been selected.
The BCS Web Parts give you many options for
creating composite applications for integrating SharePoint data with
your enterprise data. A typical extension of our composite page would
be to use the other Web Parts in the Business Data category to display
indicators relating to the customer.