With Business Connectivity Services (BCS) in Microsoft SharePoint 2010 Search, you are able to use Microsoft SharePoint 2010 Search to connect to external data, such as your Microsoft Dynamics CRM 2011 software database. BCS is able to index your external Microsoft Dynamics CRM 2011 software data using what is called an External Content Type (ECT).

Before proceeding, I recommend you reading through my previous blog post, “Search Your Microsoft Dynamics CRM 2011 Software with Business Connectivity Services in SharePoint 2010 Search”. This blog post will be building upon the example and concepts discussed previously.

In my previous blog post, I showed you how to create a Microsoft SharePoint 2010 Search web site to find all your accounts in your Microsoft Dynamics CRM 2011 database. Being able to search for any of your Microsoft Dynamics CRM 2011 accounts is great, but what if you also want to see all the Microsoft Dynamics CRM 2011 contacts associated with each account? With BCS Associations, you are easily able to do this. For this example, we will be adding to your previously created Account ECT, an Association for contacts to accounts.

Before we begin, I again want to emphasize the importance of taking complete backups before doing anything in your environment.

Step 1: Create an Association in your External Content Type

This step will add an association in your ECT between your Microsoft Dynamics CRM 2011 accounts and contacts for the connection between Microsoft SharePoint 2010 Search and the Microsoft Dynamics CRM 2011 software database.

Start Microsoft SharePoint Designer 2010 and open the site that we previously created. 

SharePoint Site Objects External Content Types 

Figure 1: Site Objects External Content Types

In the Navigation pane under Site Objects, click on External Content Types.

  1. Open the Account ECT that we previously created.
  2. Click on Operations Design View in the ribbon.
  3. Expand the CRM Data Source you previously created.
  4. Expand the Views folder.
  5. Right click on Contact and click on New Read Item Operation.
  6. Click Next.
  7. Scroll down until you see AccountId and select it.
  8. On the right side under Properties, check the Map to Identifier: box.
  9. Click Next.
  10. At the top, under Return Parameter Configuration, uncheck the Data Source Elements box.
  11. Scroll down until you see AccountId and select it.
  12. On the right side under Properties, check the Map to Identifier: box.
  13. Scroll down until you see ContactId and check the box next to it.
  14. Scroll down until you see FullName and check the box next to it.
  15. Click Finish.
  16. Right click on Contact and click on New Read List Operation.
  17. Click Next twice.
  18. At the top, under Return Parameter Configuration, uncheck the Data Source Elements box.
  19. Scroll down until you see AccountId and select it.
  20. On the right side under Properties, check the Map to Identifier: box.
  21. Scroll down until you see ContactId and check the box next to it.
  22. Scroll down until you see FullName and check the box next to it.
  23. Click Finish.
  24. Right click on Contact and click on New Association.
  25. Click the Browse… button.
  26. Select the Account (Current) ECT.
  27. Click OK.
  28. In the dropdown menu under Field, select ContactId.
  29. Click Next.
  30. Scroll down until you see AccountId and select it.
  31. On the right side under Properties, check the Map to Identifier: box.
  32. Click Next twice.
  33. At the top, under Return Parameter Configuration, uncheck the Data Source Elements box.
  34. Scroll down until you see AccountId and select it.
  35. On the right side under Properties, check the Map to Identifier: box.
  36. Scroll down until you see ContactId and check the box next to it.
  37. Scroll down until you see FullName and check the box next to it.
  38. Click Finish.
  39. Right click on the tab you are working in and select Save.
  40. Click on Create Profile Page in the ribbon.
  41. Click Yes on the Overwrite Profile Page popup.

Step 2: Crawling Microsoft Dynamics CRM 2011 Software Database

This step will crawl and index your Microsoft Dynamics CRM 2011 Database. Here you are also able to set a schedule for incremental crawls on your Microsoft Dynamics CRM 2011 database. Notice that with the Association you just created, you will be able to find all your accounts along with their associated contacts.

Start SharePoint 2010 Central Administration.

Microsoft SharePoint 2010 Central Administration
 
 
Figure 2: Microsoft SharePoint 2010 Central Administration

Under Application Management, click Manage service applications.

 

SharePoint Manage Service Applications

  Figure 3: Manage Service Applications

  1. Under Name, click Search Service Application.
  2. Under Crawling, click on Content Sources.
  3. With hovering over your CRM Content Source, click Delete.
  4. Click OK in the popup.
  5. Click on New Content Source.
  6. Type CRM in the Name field.
  7. Select Line of Business Data for Content Source Type.
  8. Select Crawl selected external data source and check the box next to CRM.
  9. Check the box next to Start full crawl of this content source.

SharePoint External Content Type Information and Permissions
 

Figure 4: External Content Type Information and Permissions

  1. Click OK.
  2. When crawl is complete, the Status should be Idle. The crawl duration will vary depending on system performance and amount of data being crawled. Click Refresh until Status says Idle.
  3. You may now test your search by heading back to the site you created and search for any of your Microsoft Dynamics CRM 2011 accounts. When clicking on an account you searched for, you should notice a second table below your Account table that contains a list of associated contacts and their information.

We now have much more meaningful search results. When we search Microsoft Dynamics CRM 2011 for Accounts, we will see all the associated Contacts to the Accounts. With a little imagination, you can use this same concept on any combination of Microsoft Dynamics CRM 2011 entities.

In the next part of this series, we will discuss how to customize the Advanced Search to add Property Restrictions to your searches.

Write A Comment