Click to Rate and Give Feedback
MSDN
MSDN Library
Microsoft Dynamics
Microsoft CRM 1.0
Technical Articles
 Adding a Custom Application to Micr...
Customer Relationship Management Technical Articles
Adding a Custom Application to Microsoft CRM: Duplicate Checking Sample
Click here to download sample - crmapp_dup.exe.
 

Microsoft Corporation

Originally published December 2002, updated March 2003

Applies to:
    Microsoft® CRM 1.0

Summary: Integrate an application that checks for accounts with duplicate telephone numbers with Microsoft Business Solutions Customer Relationship Management (Microsoft CRM). Use this sample as you create your own applications to integrate with Microsoft CRM. (5 printed pages)

Download sample code from the crmapp_dup.exe.

Contents

Adding an Application to Microsoft CRM
Sample Integration Scenario
Modify Configuration Files
Add Assembly as Reference to Solution
Customize Microsoft CRM Schema and Forms
Add Sample Code to Your Solution

Adding an Application to Microsoft CRM

Microsoft® Customer Relationship Management (Microsoft CRM) can be integrated with custom features and applications to meet unique customer requirements.

For more information about customizing the Microsoft CRM application, see the Microsoft CRM Software Development Kit (SDK).

Note   Microsoft does not provide support for this sample or any custom application using this sample.

Sample Integration Scenario

An independent software vendor (ISV) identifies a need for a solution that will integrate with Microsoft CRM to provide identification of potentially matching accounts based on telephone number. This feature is used to ensure that a lead or opportunity is not inadvertently contacted multiple times as a result of the account being in the Microsoft CRM system multiple times.

A Microsoft ASP.NET Web application using Microsoft Visual C#™ and Microsoft Visual Studio® .NET is developed for use with the Microsoft CRM platform. The ISV uses the Microsoft CRM SDK to identify the methods and the SOAP APIs to retrieve account data from the Microsoft CRM database, and then determines if an account already exists with the same telephone number. The solution updates a custom property on the account class with the account ID of the matching account. The custom property is displayed on the account form. With this integration, a database administrator can write a program that will report all records whose Duplicate Account ID is not null and can then distribute the report to the account owners to reconcile.

This sample integration describes the steps required for the integration:

  1. Modifying configuration files.
  2. Adding an assembly as a reference to the solution.
  3. Adding a custom property to the Microsoft CRM schema and a custom field to an existing form.
  4. Using C# code to retrieve information from the Microsoft CRM database.

Once the integration is in place, the Details tab on the Account form will show the customized Duplicate Check toolbar button and new field images, and there will be a new Duplicate Check form that opens when the Duplicate Check button is clicked.

Figure 1. Details tab on the Account form

Figure 2. New Duplicate Check form

Seven sample code files are available for download in the crmapp_dup.exe:

  • ISVDuplicateCheck.aspx. The Duplicate Check form.
  • ISVDuplicateCheck.aspx.cs. The code behind ISVDuplicateCheck.aspx.
  • ISVAccount.cs. The custom class to create, retrieve, and update CRMACCOUNT objects.
  • ISVQuery.cs. A query that checks for duplicate accounts.
  • Template.htm. This template was used to create ISVDuplicateCheck.aspx. The template is provided in this sample for you to use to give the look and feel of Microsoft CRM to your application: it is not required to run the sample.
  • Template.css. This style sheet defines the styles used in template.htm, and hence in the new Duplicate Check form created from the template. It should be placed in the same folder as your .aspx file(s).
  • Mnu_vSpacer.gif. This image is used in the template at the beginning of the menubar, and hence in the new Duplicate Check form. It should be placed in the same folder as your .aspx file(s).

Modify Configuration Files

There are two steps for modifying configuration files:

  1. Modify the Web configuration file to enable use of the ISV configuration file.
  2. Modify the ISV configuration file.

To modify the Web configuration file to enable use of the ISV configuration file, edit the file <installation drive and folder>\wwwroot\web.config. In the section "ISV Integration," change the setting of ISVIntegration to On.

Sample 1. Sample Web Configuration File

ISV Integration
====================================================
Using /resources/isv.config, it is possible to customize certain menus 
   and toolbars throughout the application.  This setting is provided as 
      a performance optimization; when there are no customizations to be 
         rendered, this setting should be "Off." Recommended Setting: 
            "Off" (Unless you have customized the isv.config file) Value: 
               "On" or "Off"
   <add key="ISVIntegration" value="On"/>

To modify the ISV configuration file, edit the file <installation drive and folder>\_Resources\isv.config. Add an integration point into the Microsoft CRM user interface to call a URL and pass the object ID and object type. The following code can be used, substituting the appropriate URLs for the location of your ISVDuplicateCheck.aspx file and duplicate check icon. For additional information about the ISV configuration file, see the Microsoft CRM SDK Application Integration and Customizing the Microsoft CRM Application topics.

Sample 2. Sample ISV Configuration File

<?xml version="1.0" encoding="utf-8" ?> 
<configuration>
   <Entities>
      <account>
         <!-- The Account Tool Bar -->
         <ToolBar ValidForCreate="1" ValidForUpdate="1">
         <Button Title="Duplicate Check" ToolTip="Check for 
            Duplicate Account" Icon="<your icon location>" 
               Url="http://localhost/<your 
                  solution>/ISVDuplicateCheck.aspx" PassParams="1" 
                     WinMode="0"/>
         </ToolBar>
      </account>
   </Entities>
</configuration>

Add Assembly as Reference to Solution

In order to have access to the APIs used in the sample code, add a reference to the Microsoft CRM SOAP Proxy assembly:

Microsoft.CRM.Proxy.dll

It can be found in the following path on the Microsoft CRM server CD:

..\<wwwroot>\bin\

where <wwwroot> is the location of the Microsoft CRM Web files.

For additional information about the APIs in this DLL, see the Microsoft CRM SDK Reference topics.

Customize Microsoft CRM Schema and Forms

To customize the schema, there are two steps:

  1. Add a custom attribute to the account class PotentialDuplicateAccounts by using Schema Manager in the Deployment Manager tool.
  2. Add a custom property to the account class Add custom field "Dup Account Id" by using the System Customization feature in Settings.

Add Sample Code to Your Solution

When you add the seven sample files mentioned previously to your solution, all the necessary classes to implement duplicate checking will be added. Each file includes references to the relevant section of the Microsoft CRM SDK.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker