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.
Database Details:
EmployeeDetail Table:
"EmployeeDetail" table has the following items.
ProjectDetails Table:
"ProjectDetails" table has the following items.
Relationship between ProjectDetails and EmployeeDetail tables:
Create associated External Content Type:
Project Details External Content Type:
- Open SharePoint Designer 2010.
- Click on Open Site.
- Enter the site URL and click on Open.
- Go to Navigation => External Content Types => New => External Content Type.
- Enter the details as shown in the following.
- Click on the link "Click here to discover external data sources and define operations".
- Click on "Add Connection".
- In the External Data Source Type selections select "SQL Server" and click on Ok.
- Enter the details as shown in the following.
- Right click on ProjectDetails table and click on "Create all operations".
- Click Finish.
- Save the external content type.
Employee Details External Content Type:
- Open SharePoint Designer 2010.
- Click on Open Site.
- Enter the site URL and click on Open.
- Go to Navigation => External Content Types => New => External Content Type.
- Enter the details as shown in the following.
- Click on the link "Click here to discover external data sources and define operations".
- Click on "Add Connection".
- In the External Data Source Type selections select "SQL Server" and click on Ok.
- Enter the details as shown in the following.
- Right click on EmployeeDetail table and click on "Create all operations".
- Click Finish.
- Right click on EmployeeDetail table and click on "New Association".
- Association wizard will pop up.
- Click on browse and select "Project Details".
- Click on Ok.
- In the Field select ProjectID as shown in the following.
- Click on Next and map ProjectID to Identifier as shown in the following.
- Click on Finish and you could see the following operations for the External content type.
- 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.
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:
- Go to the SharePoint site.
- Go to Site Actions => Edit the Page.
- In the ribbon interface, go to Editing Tools => Insert => Web Part.
- In the Categories, select Business Data => Business Data List.
- Click on Add.
- In the web part toolbox, you can select the "Project Details"external content type that we have created and click on Ok.
- External data will be displayed in the web part as shown in the following.
Add Business Data Related List web part:
- Go to the SharePoint site.
- Go to Site Actions => Edit the Page.
- In the ribbon interface, go to Editing Tools => Insert => Web Part.
- In the Categories, select Business Data => Business Data List.
- Click on Add.
- In the web part toolbox, you can select the "Employee Details"external content type that we have created and click on Ok.
- Now the web part looks like the following.
Connect the Business Data web parts:
- Edit the Employee Details List web part as shown in the following.
- Select Connections => Get Related Item From => Project Details List.
- In the Web Part tool pane, click OK.
- 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.
- 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.