In this walkthrough we will demonstrate how to define BCS filters for BCS External Content Types in BCS Meta Man. As of BCS Meta Man alpha 2 (released 22nd Jan 2010) we support filters for SQL and Oracle. In this sample we will use SQL server, but you can use the same steps for Oracle and define filters for Oracle tables as well.
1) Open up Visual Studio 2010 and create a new empty SharePoint project.
2) Add a new BCS Meta Man item to your project.
3) When the BCS Meta Man diagram is open, in the menu bar click on BCS Meta Man-> BCS Meta Man Data Source Explorer
4) When the Data Source Explorer is shown, click on the Add SQL Connection button.
5) In the connection dialog, set the connection parameters to your SQL database. We use the AdventureWorks database for our walkthroughs.
6) If the connection is successful it will populate the explorer treeview with our databases that you can expand to show the tables available.
7) Drag and drop any two tables you want, in this walkthrough we use Employees and Product tables; we will define a comparison filter for the Product table and a Wildcard for Employee. Your diagram should look like this.
8) Right click on the Employee table and choose Manage Entity.
9) In the Entity Management dialog go to Methods tab and select the Finder method.
10) Click on New button in the Filter section and configure a Wildcard filter for the Employee table’s Finder method. Click on Save button, and then Save the modifications.
11) Using the above mentioned steps, define a Comparison filter for the Product table.
12) If you open the generated service c# classes, you’ll find that c# methods have been modified to accept input parameters that will be used to filter the data being returned
13) Rebuild the project and press CTRL+F5 to deploy the solution.
14) Go to your SharePoint site, and add two BCS List web parts. Set Employee as a type for one of them and Product as a type for the other BCS List web part.
15) Try to enter some filter values to display the records.
<hrayr/>