Share this page

Wednesday, November 18, 2009

Creating a connection to an external repository using Business Connectivity Services

One of the changed features in SharePoint 2010 is Business Data Catalog (BDC) to Business Connectivity Services (BCS). In this presentation I would like to show how we can generate a connection to an external system and create all necessary operations for data management in 5 minutes using SharePoint Designer. 

Open SharePoint Designer and select the “Entities” option in the left menu. Once there, we are going to press the button "External Content Type", as we can see in Image 1.

[Image 1]

1_Entities

SharePoint Designer creates a new tab to configure the external entity in which we must fill the configuration data, such as display name, programmatic name and other info, as we can see in Image 2.

[Image 2]

2_New_Entity

The next step is creating the connection to the repository for our external content type. We must press the button “Operation Design View” in the Ribbon toolbar and as we can see in Image 3 a new configuration window is opened.

[Image 3]

3_Create_Conection

In this new window we are going to add a connection pressing the button “Add Connection”, this will popup the connection configuration window. The first value is the type of repository we want to connect to; after that we need to fill the values to establish the connection (In this example I’m using SQL Server) as we can see in Image 4.

[Image 4]

4_Configuring_SqlServer

Once the values are completed and saved we can see the objects of our repository, in this case the Data Base Tables, Views and Store Procedures, as we can see in Image 5.

[Image 5]

5_Selecting_Entity

For this example we are going to use the Products table and we are going to generate de basic operations (Insert, Delete, Update, Select and Identifier) for the entity. To do this we have to select the table and open the context menu to see the operation that we can create. We are going to select the option “Create all Basic Operations” as we can see in Image 6.

[Image 6]

6_Creating_Operations

SharePoint Designer will open a step by step wizard to configure the basic operation for the entity. The first step is to load the prefix for the operation and display name as we can see in Image 7.

[Image 7]

7_Wizard_Creating_Operation_Step_1

The next step is to select the fields of the table that we want use in this entity, which field will be the primary key and which fields will be used in the selector control when we use it in SharePoint. We could select all fields, as we can see in Image 8.

[Image 8]

8_Wizard_Creating_Operation_Step_2

In the last step of the wizard we can create filters to use when we are searching for data. For this example we won’t create filters, as we can see in Image 9.

[Image 9]

9_Wizard_Creating_Operation_Step_3

Once the configuration is completed we are going to press the button “Finish” to close the wizard and we can see in Image 10 that the basic operations were created for the entity.

 [Image 10]

10_Operations_Created

Now we are going to save the entity configuration with its operations, so, we have to select the button “Save” in the Ribbon toolbar and as we can see in Image 11 the save process begins.

 

[Image 11]

11_Saving_New_Entity

When the save process finishes our entity and its operations will be ready to be used in SharePoint, as we can see in Image 12.

[Image 12]

12_Entitiy_Created

In future articles I will return to the functionalities of BCS since there are other things that we need to know.

Fabián Imaz

No comments: