BCS Action created in BCS Meta Man

BDC Action are very powerful and popular in MOSS 2007. They allow you to link your Business Data to external urls such as Search Engines or other Enterprise Applications. In SharePoint 2010 you can define actions for BCS External Content Types and use them in BCS web parts the same way you do in MOSS 2007. You can get more information about BDC Actions from here

BDC Actions

SharePoint Designer 2010 and Visual Studio 2010 allow you to create BCS external content types. There is no support however to define BCS  within SharePoint Designer or Visual Studio 2010. If you want to define actions for a BCS external content type, you must deploy it to the BCS service and then open the Central Administration, navigate to BCS Service and define the BCS action there.

Create BCS action in SharePoint Central Admin

If you use BCS Meta Man to create a BCS External Content Types you can easily define BCS Action within Visual Studio 2010.

The steps below walk us through how to do it…this walk through presumes you have BCS Meta Man alpha 2 (or later) installed, you can download it from here:

BCS Meta Man Download.

1) Open Visual Studio 2010 and create new empty SharePoint project.

Create Empty SharePoint project

2) Right click on the project and select “Add New Item” and choose BCS Meta Man from the dialog.

Add BCS Meta Man project item

 

3) When this project item type is added to your project it will automatically add a new feature and open the BCS Meta Man designer. Now, from menu bar click on BCS Meta Man – > BCS Meta Man Data Source Explorer.

Open BCS Meta Man Data Explorer

4) In the data source explorer click on “Add SQL Connection” which will pop up new dialog, where you can set up the connection to your back end SQL database.

Set connection settings

5) When the connection is configured, it will populate the treeview with available databases and tables. In this walkthrough we have used the AdventureWorks database and Product table.

Drag table onto the design surface

6) Drag and drop the “Product” table to the designer and select the methods which you want to be generated by BCS Meta Man. Right click on the top of the entity and select “Manage Entity”.

Manage your BCS Entity

7) In the Entity Management Entity Tab, set the Title column for the External Content Type, so then we can use actions in the BCS Data list web part for each record. (see Step 11).

Step7a

Now click on the “Actions” tab and click on “Add Predefined Action”.

Entity Management screen

8) In “Action Picker” dialog choose any predefined action you like. In this walkthrough we have chosen “Bing”. You can create custom actions by clicking on the “Create Custom Action” button and setting the necessary parameters for a BCS Action.

Create pre defined BCS Action

9) After you have selected an action, it will fill up the BCS Action properties. You can change those properties, and add or remove action parameters.

Set BCS Action Properties

10) We need to make Bing search with the product’s Name, so we need to remove the ProductId Action parameter and add new one – Name.

Add new Action Parameter

11) When you click on the “Save” button of the entity management dialog it will add the Action to the BCS Model. Rebuild the project and press CTRL+F5 to deploy the solution. Navigate to your SharePoint site, add a BCS List web part and choose our Product External Content Type to be displayed. When data is populated you can find a dropdown on each record’s title column (Name in this example) and you can see available Actions there.

clip_image002[12]

12) When you click on “Bing” it will open search result page in new window. A Bing search query will be done by passing the Name parameter through from our BCS record.

clip_image004

 

 

 

 

 

 

 

 

<hrayr/>

Leave a comment