posts - 88 , comments - 3 , trackbacks - 0

Tutorial: Access Salesforce Leads in SharePoint through an External List

You can use the CData Cloud Driver for Salesforce to give your users the capabilities to access and update Salesforce data in SharePoint. This article shows how to create an external list of Salesforce data that is always up to date. You will use an external content type as a template for the external list. The external content type enables connectivity over Web services, the protocol that cloud driver uses to provide access to live Salesforce data.

Note that this tutorial applies to any of our data sources, not just Salesforce.

Contents

  1. Create the External Content Type
  2. Import the External Content Type
  3. Create the External List
  4. Limit and Filter Results
  5. Credentials Authentication

If you have not already connected successfully in the cloud driver administration console, see the "Getting Started" chapter in the help documentation for a guide.

Create the External Content Type

The external content type is a schema that will provide the core connectivity to Salesforce data from any SharePoint app. Call the GetSharePointSchema action to create it. Copy and paste the response into an .ect file; Account.ect, for example. In the API section of the cloud driver administration console, you can find example requests and more information on the available inputs.

Import the External Content Type

After you have created the .ect with the GetSharePointSchema action, you can follow the steps below to import it into an on-premise SharePoint installation or SharePoint Online.

SharePoint 2013

Navigate to the SharePoint central administration portal and click the link to manage service applications. In the resulting page, click Business Data Connectivity Service. Then click Import -> Choose File to select the .ect file in the dialog.

SharePoint Online

In the SharePoint admin center, click bcs from the quick launch menu and then click Manage BDC Models and External Content Types. On the resulting page, click Import.

Create the External List

You can now create SharePoint apps that can access and modify Salesforce data. Navigate to your SharePoint site and choose Site Contents -> Add an App -> External List. Then, click the Select External Content Type icon and choose the external content type that you created in the previous section. Click Create.

The first step to adding an external list in SharePoint Online: Select the external content type. (Salesforce is shown.)

Limit and Filter Results

SharePoint has limits on how much data can be retrieved from external lists of OData sources. The cloud driver sets the default limit for the number of returned rows to be 500. You can disable this limit by adding the Limit parameter and setting its value to 0. Additionally, external lists display results in pages of 30 items by default. To modify the paging size, you will need to set the Item Limit property in the settings for the default view or build a custom Web part to view the data from the external list.

In SharePoint 2013, requests to external data sources are limited by bandwidth throttling controls, which can be changed using the Set-SPBusinessDataCatalogThrottleConfig command. In SharePoint Online, requests to external data sources are limited by your Server Resource Quota and by bandwidth throttling controls; to work around this, you can apply filters in the request for data.

You can use the GetSharePointSchema Web service to apply filters when generating the schema: Add the ComparisonColumn, ComparisonOperation, and ComparisonValue parameters to the request when calling the aforementioned service. Changing the schema will redefine the data available to SharePoint users.

Credentials Authentication

The cloud driver supports a credentials-based authentication scheme using authtokens.

SharePoint Online

In this procedure, you will first create a secure store target application that will authenticate SharePoint users by providing the credentials for a cloud driver user. Next, you will create the external content type and configure it to authenticate with the credentials in the secure store. SharePoint apps patterned from the external content type can then select, insert, update, and delete data.

  1. Click secure store from the quick launch bar in the SharePoint Online administration center and then click New.
  2. In the Target Application Settings section, enter the target application Id, display name, and contact email.
  3. In the Credential Fields section, add the credentials for a user in the cloud driver. SharePoint Online will use these credentials to authenticate requests.
  4. In the Target Application Administrators section, choose an administrator who can access the connection settings for the external content type. The account for the SharePoint Online administrator is usually specified here.
  5. In the Members section, enter the users in SharePoint who are authorized to connect with the credentials of the specified user in the cloud driver.

  1. The configuration page for the new target application in SharePoint Online. (Salesforce is shown.)
  2. Store the credentials for the user in the cloud driver: Return to the list of target applications by clicking secure store from the quick launch bar. Click the target application and then click Set Credentials from the menu. Enter the username and password for a cloud driver user.
  3. Create a new connection settings object: Click bcs from the quick launch bar and then choose the option to manage connections to online services. Click Add. Name the connection and enter the URL of the OData endpoint, https://your-server/api.rsc. Select the option to use credentials stored in SharePoint. Enter the application Id for the target application you created.
  4. Call the GetSharePointSchema action to generate the external content type. In addition to the TableName parameter, add the following parameters: Add the AuthMode parameter and set the value to Credentials. Add the TargetApplicationId parameter and set the value to the Id of the secure store target application. Add the ODataConnectionSettingsId parameter and set this value to the Id of the connection settings object. Save the output from this Web service as an .ect file.

  5. Import the .ect file: Open bcs from the quick launch bar and click the link to manage BDC models and external content types. Click Import.

SharePoint 2013

In this procedure, you will first create a secure store target application that will authenticate SharePoint users by providing the credentials for a cloud driver user. Next, you will create the external content type and configure it to authenticate with the credentials in the secure store. SharePoint apps patterned from the external content type can then select, insert, update, and delete data.

  1. Browse to the central administration area for your SharePoint site and click the link to manage service applications.
  2. Click Secure Store Service and then click New.
  3. Enter the application Id, display name, and contact email to configure the new secure store target application. For SharePoint 2013, the target application type should be set to Group.
  4. On the next page, add the field names and field types to display when the user enters their username and password. To use credentials authentication, select the username and password field types.
  5. Next, in the Target Application Administrators section, choose administrators who are authorized to access connection settings for the external content type. In the Members section, enter the users in SharePoint who are authorized to connect with the credentials of the user in the cloud driver.

After you create the new secure store target application, follow the procedure below to set the credentials that users in SharePoint will provide when accessing the cloud driver:

  1. On the secure store service applications page, click the link to the target application and click Set Credentials from the menu.
  2. In the resulting menu enter the username and password.
  3. Open an instance of the SharePoint management shell and initialize a new SharePoint connection object. The connection object is site-specific: Set the ServiceContext parameter to the site you want and set the ServiceAddressURL parameter to the URL of the OData endpoint. Set the AuthenticationMode to Credentials. Enter the application Id for the target application you created.

    New-SPODataConnectionSetting -AuthenticationMode Credentials -ServiceAddressURL http://your-server/api.rsc -ServiceContext http://myspsite/ -Name MyODataConnectionId -SecureStoreTargetApplicationId your-target-application-Id

    The output below shows that the command has executed successfully:

The final steps in using credentials authentication involves creating the external content type for the table you want to expose in SharePoint, configuring it to authenticate with credentials from the secure store, and then importing it into SharePoint.

  1. Call the GetSharePointSchema Web service and then enter the table name. In addition to the TableName parameter, add the following parameters: Add the AuthMode parameter and set the value to Credentials. Add the TargetApplicationId parameter and set the value to the Id of the secure store target application. Add the ODataConnectionSettingsId parameter and set this value to the Id of the connection settings object.
  2. To import the external content type into SharePoint, point your browser to the SharePoint central administration portal and click the link to manage service applications.
  3. Click Business Data Connectivity Service in the resulting page. Click Import and select the .ect file in the dialog.
  4. You can now create the external list. On the Site Contents page on your SharePoint site, click the button to add an app and then click the icon to choose the external content type.

Back to Top

 

Print | posted on Monday, February 3, 2014 5:44 AM | Filed Under [ salesforce .net sharepoint cdata ]

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: