July 14, 2010 01:06 PM

Q: How Can I Create an Action for an External Content Type in SharePoint?

SharePoint Pro
InstantDoc ID #125605
Rating: (10)

By Stefan Kowalewski, Tomek Stojecki, and Ethan Wilansky

Q
: How can I create an action for an external content type (ECT) in the Business Data Connectivity Model (BDCM) if I don't want to use SharePoint Designer?

A: Here's a possible solution: While you can add an Action to the ECT in Central Admin, another approach is to edit the XML in the BDCM. Add the following code to the Entity element of your BDCM:

<Actions>

<ActionName="Name of Action"Position="1"IsOpenedInNewWindow="true"Url
  ="NavigateToUrl.aspx?Id={0}">

<ActionParameters>

<ActionParameterName="ParameterId"Index="0" />

</ActionParameters>

</Action>

</Actions>

 

The name of the Action will be displayed as the text in the list of actions. You can also add as many parameters as necessary. Just be sure to assign a property to each parameter.

Add the following XML to the Properties element of your Entity to set the Action as default:

<PropertyName="DefaultAction"Type="System.String">Name of Action</Property>

 

Only one Action can be set as the default.

There are a couple items worth noting with this approach:

  • Actions don’t appear in BDC Explorer in VS2010. In order to add or edit the Actions you have to open the BDCM in the XML editor or Notepad.
  • If you update your Action in the BDCM, delete the ECT from Central Admin before deploying it. You may also need to delete and re-add the list before the Actions are available on the list.

See all the SharePoint Q&As:
Sharepoint Q&A: How Can I Create an External List When SharePoint Throws an Unspecfied ASP.NET Error?

Sharepoint Q&A: How Can I Create an Action for an External Content Type in SharePoint?

Sharepoint Q&A: How to Make a Type String Type Descriptor a Required Field in the BDC Explorer

Sharepoint Q&A: Data Source Conflict

 

Related Content:

ARTICLE TOOLS

   
Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
   

Dan Holme's Viewpoint on SharePoint Blog

Office 15 Technical Preview… And Penguins

Microsoft announced the Office 15 Technical Preview on January 30--here's what it is, why you might...

SharePoint Pro: By Admins, Devs, & Industry Observers

5 Steps to Making SharePoint Information Architecture Work for You

To make SharePoint work for you, a strong base of information architecture offers the structure...

Open Text Sponsored Blog

Governance: It Doesn’t Matter What, It Really Matters Who

Over the years one of the many things I’ve been involved with is governance. To most the word...