Share via


Step 3 (Optional): Define Actions

Entities in the Business Data Catalog can have actions defined and associated with them. Actions bridge the gap between Microsoft Office SharePoint Server 2007 and a native application user interface by providing a link back to the back-end data source. You can use actions to build applications with write-back scenarios, such as a Customer Profile view that allows a user to update profile information directly in SAP. Actions are implemented as links, so you can also use actions to perform simple tasks such as sending e-mail messages or opening a customer's home page.

Actions remain associated with an entity, no matter where you use the entity. That is, after you define an action for an entity, the action will be visible everywhere you display that entity, whether it is in a Business Data Web Part, a Business Data column, or some other location.

In this step, you will add an action to the Product entity called "Search on MSN". As the name implies, this action opens a browser and searches for the product name on MSN.

Important

The ActionParameter name should be the same as the TypeDescriptor name for the parameter.

Prerequisites

Step 2: Define Entities, Methods, and Filters

To add an action to an entity

  1. Open your AdventureWorks2000.XML metadata XML file from Step 2.

  2. Insert the following XML to replace the <!--Insert Action XML Here --> section in that file:

          <Actions>
           <Action Name="Search on MSN" Position="1" IsOpenedInNewWindow="true" 
                   Url="https://search.msn.com/results.aspx?q={0}" ImageUrl="">
            <ActionParameters>
             <ActionParameter Name="Name" Index="0" />
            </ActionParameters>
           </Action> 
          </Actions>
    
  3. Save the XML file.

  4. Before you add the application definition again, you must delete the AdventureWorksSample application you created in Step 1 from the Business Data Catalog. To delete AdventureWorksSample, follow these steps:

    1. Open SharePoint 3.0 Central Administration.

    2. In the left navigation pane, click the name of your Shared Services Provider (SSP).

    3. In the Business Data Catalog section, click View Applications to view the registered applications.

    4. Click AdventureWorksSample to open the View Application: AdventureWorksSample page.

    5. Finally, click Delete Application in the Application Settings section.

  5. Now, add the application definition to the Business Data Catalog. For details, see How to: Add an Application Definition to the Business Data Catalog.

Test the metadata. Business Data Actions are links that remain associated with the entity, no matter where you use it. You can test actions by creating a Business Data List Web Part or a Details Web Part, or by adding a Business Data column. For details, see Testing the Metadata. In your testing, you should see the action, Search on MSN, associated with the Product entity instances.

Next Steps

Step 4 (Optional): Define Associations

See Also

Tasks

AdventureWorks SQL Server 2000 Sample

Concepts

Business Data Catalog: Metadata Model