SharePoint 2010 – Creating Actions In External Content Types

SharePoint 2010 Business Connectivity Services (BCS) can be used to surface external Line of Business Data inside of SharePoint presenting the data as if it were a native SharePoint list. This document will describe how to create an action on an External List that will pass parameters from the list to Bing Maps. This action will take items from the selected row and pass them as parameters to Bing Maps:

BCSAction-29

Create External Content Type (ECT)

  • Launch Microsoft SharePoint Designer 2010
  • Open the site that will contain the ECT
  • Click on the “External Content Types” object in the “Site Objects” navigation menu and then click on the “External Content Type” button to begin the process of creating a new ECT:

BCSAction-01

Define ECT

  • In the “External Content Type Information” section enter the “Name” and “Display Name” fields followed by clicking on the “Click here to discover external data sources and define operations.” link.

BCSAction-02

Configure External Connection
  • Create a connection to the external system if one does not already exist.
    • Click the “Add Connection” button

BCSAction-03

    • Select the “Data Source Type” in the “External Data Source Type Selection” screen and choose the “SQL Server” data source type.

BCSAction-04

    • Enter the connection information on the “SQL Server Connection” screen. Note that using the “Connect with User’s Identity” option will require Kerberos authentication to be enabled if the SQL Server instance resides on a remote server.

BCSAction-05

Define ECT Actions

  • Expand the connection and right click the targeted table, view or procedure to generate the operations. At a minimum the “New Read Item Operation” and “New Read List Operation” actions will need to be created.

BCSAction-06

BCSAction-07

Define Operation Properties

  • Step through the Read Item and Read List screens to define both operations. Accept the defaults on the initial screen.

BCSAction-08

  • In this example there are no errors or warnings on the “Input Parameters” section so click “Next” to continue:

BCSAction-09

  • The “Return Parameter” screen has one warning, but we can ignore that since we will not modify the data. Click “Finish” to create the Read Item operation and repeat the steps for the Read List operation.

BCSAction-10

  • On the “Read Operations” action accept the default properties and click “Next” to continue:

BCSAction-11

  • There’s one warning that we can ignore in this case, but typically you’ll want to include a limit filter.

BCSAction-12

  • On the Return Parameters screen accept the defaults and click “Finish”.

BCSAction-13

  • On the Operations Designer screen you should now have two operations listed in the “External Content Type Operations” section.

BCSAction-14

  • Save the ECT

Assign Permissions to the ECT

Now that the External Content Type has been created for the Sales.vStoreWithAddresses view in the AdventureWorks database we need to assign permissions to those who should be able to consume and modify the ECT.

  • Launch the SharePoint Central Administration Site
  • Click on the “Manage service applications” link in the “Application Management” section of the page.

BCSAction-15

  • Click on the link to the Business Data Connectivity Service application:

BCSAction-15.5

  • Verify the View is set to “External Content Types” and then select the “SalesStoreWithAddress” ECT that was just created followed by clicking the “Set Object Permissions” button on the ribbon bar.

BCSAction-16

  • To ensure all users can consume the ECT add the NT AUTHORITY\Authenticated Users group and grant it “Execute” permissions.

BCSAction-17

BCSAction-18

  • Add at least 1 additional user or group to the ECT with “Set Permissions”. This is required so the object can be managed moving forward and in this example we’ll add the MYHOME\domain admins group followed by clicking OK to complete the action.

BCSAction-18.5

Add Action to External Content Type

  • In the Business Data Connectivity Service application configuration screen select the drop down menu for the “SalesStoreWithAddress” ECT and click the “Add Action” option.

BCSAction-19

Configure Settings

  • Name
    • Action Name
      • Bing Map
  • URL
  • URL Parameters
    • Parameter Property
      • AddressLine1
      • City
      • StateProvinceName
      • PostalCode

BCSAction-20

  • The action will be displayed in the “External Content Type Information” screen:

BCSAction-21

Create External List

There are a couple of options on how to create the External List in both SharePoint designer and from the browser. I’ll demonstrate an example of each.

SharePoint Designer

  • Navigate to the External Content Types in the “Site Objects” menu

BCSAction-22

  • Right click the ECT and select the “External List Option”

BCSAction-23

  • On the “Create External List” screen populate the “Name” and optionally the “Description” fields:

BCSAction-24

Browser

  • Navigate to the SharePoint Site that hosts the ECT
  • From the “Site Actions” menu select “More Options”
  • Select “List” in the “Filter By:” section
  • Select the “External List” option
  • Click the “Create: button

BCSAction-25

  • Enter the values to create the list and select the External Content Type that the list will be based off of.

BCSAction-26

Test List Action

  • Navigate to the SalesStoreWithAddresses list that was created in the previous step.
  • Click the dropdown option from an item in the “BusinessEntityID” column followed by selecting the “Bing Map” action that we configured for the ECT.

BCSAction-27

  • The browser should navigate to Bing Maps and pass along the address information from the External List

BCSAction-28

Advertisements
Tagged with: , ,
Posted in BCS, SharePoint 2010
3 comments on “SharePoint 2010 – Creating Actions In External Content Types
  1. Rachna Mehta says:

    When you select action , can the content be opened in a new tab instead of a new browser window?

  2. HK says:

    Sorry – Question is : Why action needs to be added?

    • jasonth1971 says:

      Hello,

      The actions are simply drop down options and in this example the “Bing Map” is a drop down option on the “BusinessEntityID”. When the user selects this option the address will get passed to Bing and a map will be rendered.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: