Upscale a BCS Model created in SharePoint Designer 2010

 BCS Meta Man, Business Connectivity Services, SharePoint 2010.

SharePoint Designer 2010 is a great tool for putting together simple External Content Types, but often you will want to create your External Content Types in Visual Studio to give you the full power of c# code. Unfortunately with the BCS tooling that comes with Visual Studio there is no way to take a model built in SharePoint Designer 2010 and upscale it to a Dot Net Assembly based model. Using BCS Meta Man however you can do exactly this. BCS Meta Man will allow you to select your BCS Model built by SharePoint Designer and then generate all the c# methods and BCS model you need to be able to then take it further and customize it any way you like.

In this blog post we will show you how to create an External Content Type with SharePoint Designer 2010 and then upsize them with BCS Meta Man.

1) Open SharePoint Designer 2010 and click on Open Site.

clip image002 thumb Upscale a BCS Model created in SharePoint Designer 2010

2) Enter your SharePoint site’s URL. In the left side you’ll see the navigation panel, select External Content Types.

clip image004 thumb Upscale a BCS Model created in SharePoint Designer 2010

3) At the top you can find the “External Content Type” button, click on it to create a new BCS External Content Type.

clip image005 thumb Upscale a BCS Model created in SharePoint Designer 2010

4) Set the Name, Display name(Departments) of your new External Content Type and click on the hyperlink to discover External Systems

clip image007 thumb Upscale a BCS Model created in SharePoint Designer 2010

5) When you click on the hyperlink, a new page will be opened to set up a connection to your back end database/WCF service or .Net assembly. Click on Add Connection button.

clip image009 thumb Upscale a BCS Model created in SharePoint Designer 2010

6) Select SQL Server

clip image011 thumb Upscale a BCS Model created in SharePoint Designer 2010

7) Set parameters for the connection to your database. In our walkthroughs we use Adventure Works database. Click OK.

clip image013 thumb Upscale a BCS Model created in SharePoint Designer 2010

8) Expand the populated treeview, select the Departments, right click on it and select Create all operations.

clip image015 thumb Upscale a BCS Model created in SharePoint Designer 2010

9) Click on Finish, so SharePoint Designer will create all the methods for your BCS External Content Type.

clip image017 thumb Upscale a BCS Model created in SharePoint Designer 2010

10) Press CTRL+S to save our Departments External Content Type

clip image019 thumb Upscale a BCS Model created in SharePoint Designer 2010

11) Please repeat the same steps and create another external content type for Employee table of the AdventureWorks database. Name it Employees.

clip image021 thumb Upscale a BCS Model created in SharePoint Designer 2010

12) Now we need to export these two external content types to XML file so that we can upscale them in BCS Meta Man. Select both external content types, right click on them and select Export Application Model.

clip image023 thumb Upscale a BCS Model created in SharePoint Designer 2010

13) Set the Model Name.

clip image024 thumb Upscale a BCS Model created in SharePoint Designer 2010

14) Set where our application model should be exported to.

clip image026 thumb Upscale a BCS Model created in SharePoint Designer 2010

Now we have a BCS application model of Departments and Employees External Content Types. Next we need to upsize it in BCS Meta Man. BCS Meta Man will generate C# code for all the methods that you have defined in SharePoint Designer and also we will create an Association between them easily.

15) Open up Visual Studio 2010 and create a new empty SharePoint project.

clip image028 thumb Upscale a BCS Model created in SharePoint Designer 2010

16) Right click on the the project and add a new BCS Meta Man item to the project.

clip image030 thumb Upscale a BCS Model created in SharePoint Designer 2010

17) When the project item is added, BCS Meta Man’s design surface is opened. Go to menu bar and select BCS Meta Man->Import SPD generated XML file.

clip image031 thumb Upscale a BCS Model created in SharePoint Designer 2010

18) File open dialog will appear. Select the BCS application model we generated from SharePoint Designer

clip image033 thumb Upscale a BCS Model created in SharePoint Designer 2010

19) BCS Meta Man will now create External Content Types for Departments and Employees ECTs that we created with SPD 2010. It will add new c# files to your project so you can modify c# methods that have been generated by BCS Meta Man for each BCS method

clip image035 thumb Upscale a BCS Model created in SharePoint Designer 2010

20) View the toolbox and create an association between those two External Content Types.

clip image036 thumb Upscale a BCS Model created in SharePoint Designer 2010

21) Rebuild the project and press CTRL+F5 to deploy the solution.

22) Open your SharePoint site, add BCS List and BCS Related List web parts to the page. Set Departments as a type for List web part, and Employees as a type for Related List web part. Connect those two web parts so List web part should send data to the related list web part. When everything is done you can select an item in Departments list web part and see associated data in related list web part.

clip image038 thumb Upscale a BCS Model created in SharePoint Designer 2010

23) Now, let’s see if Creator and Updater methods have been upsized properly. Create a new External List in your SharePoint site and set Departments as a type for that list.

You’ll see that “New Item” and “Edit Item” buttons are enabled, which means BCS Meta Man has declared(upsized) those methods properly, try to insert and update some departments

clip image040 thumb Upscale a BCS Model created in SharePoint Designer 2010

<hrayr/>

  1. This article demonstrates how to create a reusable component in ASP.NET 2.0 and then consume it from an ASP.NET page. Also learn how the ObjectDataSource control can be used to directly bind the output of an object to the controls in an ASP.NET page and how precompilation can be used to increase the performance of the Web application and catch compilation errors…..

     
  2. Caridad Reyes

    Quiero probar lo que cuentas …. mi problema es que instale el Visual Studio 2010 en mi PC, pensando que podria creame un proyecto de “Modelo de conectividad BCS” y no me deja, dice que necesito tener el Sharepoint instalado.

    Mi pregunta es, para desarrollar se requiere que sea en el mismo PC donde este instalado el Sharepoint 2010? O que se puede hacer?

    Graciassss

     

Leave a Comment

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

*