Business Data Related List Web Part in SharePoint 2010

Introduction:

Business Data Related List Web Part in SharePoint 2010 is used to display a list of related entity instances from a business application.

Data Source:

I have created a database in SQL which contains two tables.

BussSha1.gif

Database Details:

BussSha2.gif

EmployeeDetail Table:

"EmployeeDetail" table has the following items.

BussSha3.gif

ProjectDetails Table:

"ProjectDetails" table has the following items.

BussSha4.gif

Relationship between ProjectDetails and EmployeeDetail tables:

BussSha5.gif

Create associated External Content Type:

Project Details External Content Type:

  1. Open SharePoint Designer 2010.
  2. Click on Open Site.

    BussSha6.gif
     
  3. Enter the site URL and click on Open.
  4. Go to Navigation => External Content Types => New => External Content Type.

    BussSha7.gif
     
  5. Enter the details as shown in the following.

    BussSha8.gif
     
  6. Click on the link "Click here to discover external data sources and define operations".
  7. Click on "Add Connection".
  8. In the External Data Source Type selections select "SQL Server" and click on Ok.

    BussSha9.gif
     
  9. Enter the details as shown in the following.

    BussSha10.gif
     
  10. Right click on ProjectDetails table and click on "Create all operations".

    BussSha11.gif
     
  11. Click Finish.

    BussSha12.gif
     
  12. Save the external content type.

Employee Details External Content Type:

  1. Open SharePoint Designer 2010.
  2. Click on Open Site.

    BussSha13.gif
     
  3. Enter the site URL and click on Open.
  4. Go to Navigation => External Content Types => New => External Content Type.

    BussSha14.gif
     
  5. Enter the details as shown in the following.

    BussSha15.gif
     
  6. Click on the link "Click here to discover external data sources and define operations".
  7. Click on "Add Connection".
  8. In the External Data Source Type selections select "SQL Server" and click on Ok.

    BussSha16.gif
     
  9. Enter the details as shown in the following.

    BussSha17.gif
     
  10. Right click on EmployeeDetail table and click on "Create all operations".

    BussSha18.gif
     
  11. Click Finish.

    BussSha19.gif
     
  12. Right click on EmployeeDetail table and click on "New Association".

    BussSha20.gif
     
  13. Association wizard will pop up.
  14. Click on browse and select "Project Details".

    BussSha21.gif
     
  15. Click on Ok.
  16. In the Field select ProjectID as shown in the following.

    BussSha22.gif
     
  17. Click on Next and map ProjectID to Identifier as shown in the following.

    BussSha23.gif
     
  18. Click on Finish and you could see the following operations for the External content type.

    BussSha24.gif
     
  19. Save the external content type.

Set the permissions:

Once you have created the external content types using SharePoint Designer , Go to Central Administration => Application Management => Manage Service Applications => Business Connectivity Service application => you could be able to see the external content type that you have created using Designer as shown in the following.

BussSha25.gif

Set the permission for the external content type (Refer http://www.c-sharpcorner.com/UploadFile/anavijai/4252/).
 
Add Business Data List web part for "Project Details" external content type:

  1. Go to the SharePoint site.
  2. Go to Site Actions => Edit the Page.
  3. In the ribbon interface, go to Editing Tools => Insert => Web Part.
  4. In the Categories, select Business Data => Business Data List.

    BussSha26.gif
     
  5. Click on Add.
  6. In the web part toolbox, you can select the "Project Details"external content type that we have created and click on Ok.

    BussSha27.gif
     
  7. External data will be displayed in the web part as shown in the following.

    BussSha28.gif

Add Business Data Related List web part:

  1. Go to the SharePoint site.
  2. Go to Site Actions => Edit the Page.
  3. In the ribbon interface, go to Editing Tools => Insert => Web Part.
  4. In the Categories, select Business Data => Business Data List.

    BussSha29.gif

     
  5. Click on Add.
  6. In the web part toolbox, you can select the "Employee Details"external content type that we have created and click on Ok.

    BussSha30.gif
     
  7. Now the web part looks like the following.

    BussSha31.gif

Connect the Business Data web parts:

  1. Edit the Employee Details List web part as shown in the following.

    BussSha32.gif
     
  2. Select Connections => Get Related Item From => Project Details List.

    BussSha33.gif
     
  3. In the Web Part tool pane, click OK.

    BussSha34.gif
     
  4. In the Business Data List (Project Details List) Web Part, click the diagonal arrow next to a row of data, as shown in the following illustration.

    BussSha35.gif
     
  5. Notice that the page refreshes and the Business Data Related List (Employee Details List) Web Part displays the associated data for the selected item, as shown in the following.

    BussSha36.gif