External Lists are a great new feature in SharePoint 2010 that allow you to expose your Business Connectivity Services (formerly known as the Business Data Catalog) entities to end users through the familiar SharePoint list UI. This feature supports both reading from and writing to your line-of-business data sources via SharePoint. The major benefit of this is that it allows users to get at and update all of the data they need for a particular business process in one place regardless of whether that data is housed in SharePoint or elsewhere. In many cases, all of this can be done without writing a single line of code.
In past versions of SharePoint, creating a Business Data Catalog entity meant writing and maintaining a ton of XML. In SharePoint 2010, that XML is still there but there is now an easy to use UI built into SharePoint Designer that makes creating BCS entities a snap. SharePoint Designer even allows you to create an External List based on your BCS entity with just a few button clicks.
To get started, open up SharePoint designer and connect to your SharePoint 2010 site.
In the Navigation page, select the Entities tab.
Then select External Content Type from the ribbon.
This will create a new External Content Type panel in the main frame. In this panel, enter a Display Name and Programmatic Name for your External Content Type.
Then click where prompted to created a data source and define operations. This will switch you from the entity’s Summary View to the Operations Design View where your first task is to define a data source. Get started with this by clicking the Add Connection button.
SharePoint Designed supports four different Data Source Types as shown below.
In our example, we will create a data source based on a SQL Server table. Select the SQL Server Data Source Type and enter in the connection information.
Your database will now appear in the Data Source Explorer window and you can select the database objects that you wish to use to create the operations for your entity.
If you select a table, you can choose the Create All Basic Operations option and SharePoint Designer will create the CRUD and Finder operations for you.
Step through the wizard accepting the default values and you will end up with something like this.
Now switch back to the Summary View and click the Create Lists & Forms button in the ribbon.
Click yes when prompted to save the External Content Type. This will cause the entity definition to be published to the BCS data store.
Enter a list name a click ok to finish creating your External List.
SharePoint Designer will create the list and its associated forms. When this process is complete, you can go to your SharePoint site to view the list.
Now you can interact with the data in your database table just as if it were stored in a native SharePoint list. This includes the ability to use your External Lists as data sources for data view web parts, InfoPath forms, Office Client forms, and lookup columns. It even includes support for offline interaction and synchronization using SharePoint Workspace (formerly known as Groove).
For more control over your entities and how they interact with the source system, you can create your own entity definitions based on .NET Types in Visual Studio 2010. For more information on this, check our my two part post on the topic.
Tags: sharepoint 2010