-
Dynamics CRM 3.0: The problem of duplicate email addresses
In case you didn't know, CRM 3.0 has a real issue should it find the same email address in more than one location ( i.e., Contact, Account, System User, etc ).
For example, let's say you have a company of 20 people and you create an Account for your company within CRM and add each of the employees as Contacts. You populate their contact information as you normally would for any Contact.
Without knowing it, you've just broken CRM.
Here is the result of above operation:

The problem lies in the fact that CRM can't resolve the email address to a single individual so rather than prompting you to make the decision, it will merely create a message alerting you. Not to the fact that it found more than one email and it doesn't know which one to pick, but to the fact that it can't resolve the email address.
Not exactly clearest warning message I've ever seen, and one which that took me a while to locate the cause.
I'm not exactly sure this is the best way to handle the situation because unless the user knows what is going on, it can cause a whole lot of confusion. In the above example, what it appears that CRM is telling you, is that it doesn't know who you are? Clicking on the email address in red will allow you to select the correct email acount and solve the issue, but it will make the user say, "but that was the same address that was there before." And they would be correct.
So, the moral to the store is to keep the emails unique within the system.
The Problem:
And how do I find out if I have any duplicate emails?
The Solution:
With the SQL Script that I have attached to this article.
How it works:
- Unzip CRMDupCheck.zip and you will find CRMDupCheck.sql.
- Open SQL Enterprise Manager.
- Navigate to the MSCRM database.
- Open Query Analyzer.
- Open CRMDupCheck.sql
- Click the Execute button. Assuming you have duplicate emails, the output should look something like this:

Download it here.
Dynamics CRM 1,711 views -
Development: Documenting C# functions
If you didn't know, placing your cursor on the line above a function and typing: /// will cause Visual Studio to insert a XML comment block, much like this:

This information is collected and written to an XML documentation file when you build your project ( assuming you've specified the XML file in the Project Properties ).
You can then use a tool like NDoc to generate Windows and HTML help file documentation for your project. Here is an example of the XML comment shown above as a Windows Help file:

The problem I ran into this week was the inability to change the format of the XML comment block. It's just not something that Microsoft anticipated so they didn't create any method for customization.
Fortunately, they did include a macro called InsertDocComments in Visual Studio 2003 that will insert comments into all functions within a specified class file. I simply modified this macro to produce the format I wanted:

Which, when read by NDoc, would generate the following documentation:

Installation:
- Unzip InsertDocComments2.zip and you will find the InsertDocComments2.vb function.
- Select Tools, Macros, Macros IDE.
- In the Project Explorer window, right-click on the tree into which you would like to place this function.
- Select Add Existing Item.
- Select InsertDocComments2.vb and click OK.
- Click the Save button.
The macro is now part of our macro library.
Additional Notes:
I also modified the macro to remove any exiting XML comments before inserting the new comments. I have yet to test this with VS2005, so I'm not sure if any changes will be required.
The one caveat I did notice about this macro is that the class file must be part of a project. If you just open a .CS file and attempt to run this macro, you'll receive an error.
Download it here.
If you find any errors, please let me know.
Development 1,236 views -
Release: Utility to generate picklist options for Dynamics CRM 3.0
Last month I mentioned that I had created a small utility the generate the XML code required to populate a CRM 3.0 picklist.
I decided to go ahead and release it, as is. Here is a screen shot:

Here is how it works:
- In the text box on the left ( Source ), enter your Picklist Options. One per line
- Picklist options are generally numbered sequentially starting with 1. If you need your list to start with a different number, change the Starting Option Count to reflect that number.
- Click the Generate button to generate the XML.
Its formatted funny due to the XML CRM requirements, so don't change anything. - Click the Copy to Clipboard button to copy the contents of the Destination text box to the clipboard.
- Launch WordPad and open the Customizations exported from CRM.
- Locate your picklist and replace the Options with the code generated by this utility.
( just highlight it and select Edit, Paste ) - Save your customization file.
- Import into CRM and Publish Customizations.
That's it.
Requirements:
- .NET 1.1 runtime.
Installation Process:
- Unzip the CRMGenOptions.zip file.
- Double-click on CRMGenOptions.exe to run.
Download it here.
If you run into any issues, please let me know. As I mentioned in an earlier post, this functionality will be built into another utility that I'm creating to assist CRM Customizers.
Additional Info
A week or so ago, Kjell-Sverre Jerijærvi mentioned the possibility of using Excel to generate Picklist Option XML. Well, I tried it this morning and found that Excel generated so much extra "stuff" that it would have been useless to import it into CRM.
Not being an Excel expert, I'm hoping that Kjell will give it a try and if successful, post a sample that we can all use.
Customization, Dynamics CRM 6,082 views -
Using SQLDMO
The Microsoft SQLDMO library is very handy should you need to perform functions that can normally be found in SQL Enteprise Manager such as:
- Creating databases
- Backing up a database
-
Restoring a database
- Finding SQL Servers
- Enumerating databases found on a particular server
- Etc.
I've been working on a couple of applications that use many of the features of SQLDMO and have found the following articles to be very useful, should you need to use SQLDMO yourself:
How to distribute and how to install SQL-DMO for SQL Server 2000
PRB: "SQLDMO Has Not Been Registered" Error Message If You Remove SQL Server Desktop Engine
This article is important because if you follow the instructions outlined in the first article on how to distribute SQLDMO, you can actually break SQLDMO should you ever uninstall your application. The uninstall will not delete SQLDMO, should it previously exist, but it will unregister it, which will, in effect, make it unusable to any other applications that attemp to use it.
Development 1,054 views -
Miss April
So my friend Bruce W. was at Hooters in Lewisville the other day and said that Holly, a new waitress ( and recent graduate from Texas Tech in Lubbock), was Miss April in the Hooters calendar. Bruce said she was pretty hot.
I told him that in my experience, that any woman who has a title beginning with "Miss" and ending in a month of the year, generally was.
Your mileage may vary. :)
Meanderings 902 views -
More Popups and Dynamics CRM
As I wrote in a previous article, popups can cause the CRM web client to not display at all, due to the nature of CRM web application startup mechanism.
Most of today's popup blockers require you to naviate to a site in order to add it to the blocker's "safe" list. This is more than a little difficult of the browser window disappears the moment it is displayed.
To circumvent this issue, all you need to do is navigate to the following URL:
http://[crm server]/loader.aspx
Note: Replace [crm server] with the address of your CRM server.
This will load the CRM web applications main page in a normal browser window. Once displayed, you can click on whatever menu or button you popup blocker has to add the site to the "safe" sites list.
Starting CRM normally should work at this point.
Dynamics CRM 910 views -
Dynamics CRM 3.0: Reinstalling the CRM Server
A couple of months ago I was working on a CRM installation when I noticed an Event Log message that was similar to the following:
Event Type: Warning
Event Source: SQLSERVERAGENT
Event Category: Job Engine
Event ID: 208
Date: 8/18/2006
Time: 7:00:01 AM
User: N/A
Computer: SERVER
Description:
SQL Server Scheduled Job 'Start_Incremental on Company_Name_Inc__MSCRM.ftcat_documentindex.[7.5]' (0×00000000000000000000000000000000) – Status: Failed – Invoked on: 2006-08-18 07:00:01 – Message: The job failed. The Job was invoked by Schedule 41 (Indexed Document Title Schedule). The last step to run was step 1 (Full-Text Indexing).We had come into the customer after another partner had installed and removed CRM. It turns out that the above message was caused by an artifact left over from the previous installation.During installation, the installation program will replace any invalid characters in the Organization Name with an underscore, and used that modified name for creating the databases and other items within SQL.The initial installation was created with the Organization Name of "Company Name Inc." which was converted to "Company_Name_Inc_" when the SQL objects were created.My installation was created with "Company Name Inc" which translated into "Company_Name_Inc".
Somewhere along the line, one of the CRM maintenance tasks was left running from the previous installation. Since the database it worked against no longer existed, it generated a warning each time it attempted to start.
The solution was to locate the improper task and delete it, using the following steps:
( Assuming SQL 2000 )
-
Open SQL Server Enterprise Manager
-
Expand Management
-
Expand SQL Server Agent
-
Click on Jobs
-
The Job that contains an Organizational Name that doesn't match the Organization Name in the other Jobs needs to be deleted
Dynamics CRM, Installation 2,069 views -
-
Dynamics CRM 3.0: When removing CRM, remember the email rules
If for some reason, you decide to uninstall CRM, you need to take into consideration any workstations that may have the Outlook Client installed.
Before you uninstall the CRM server, run the Rule Deployment Wizard and remove the CRM Rule from Outlook for each deployed user.
In the case of CRM Small Business Edition, the Uninstall will remove the CRM mailbox.
CRM Professional will produce different results because, in many cases, the CRM Server and the Exchange Server are on different computers and the Uninstall of CRM will not affect the Exchange Forwarding service.
Removing the Rule is important because if you don't, it will attempt to forward email to the now non-existent CRM Mailbox which will cause the user to receive a bounce email any time they get an email that may have the CRM Tracking Token in the subject.
Dynamics CRM, Outlook Client 2,112 views -
.NET Developers: Take a look at Project Anvil
Dana Epp, one of Microsoft's Security MVPs, has started a new product development effort he calls Project Anvil. Here is Dana's goal for the project:
I am about to endeavor on the path of "forging" a new product, from vision to reality, in 30 days. One man. One product. Ready for beta in 4 weeks. And the entire process blogged here in both traditional text blogging with screencasts (thanks to Camtasia Studio) peppered in showing some of the interesting things I do during the software development process.
Any of you interested in enhancing your development skills should spend a little time watching Dana's screencasts.
Dana is a very informative presenter and I pick up a new tool or technique with each screencast.
The one I learned about in his latest article is Eric Gunnerson's Regular Expression Workbench – a tool that allows you to develop, test, and validate regular expressions. Check it out as well.
Development 1,239 views -
Dynamics CRM 3.0 SDK version 3.0.5 released
Here is a summary of the changes to this version:
New and updated topics Description of changes Updated the file SDK Readme.htm with known issues and workarounds. This can be found in the download version of the SDK at msdn.microsoft.com/MBS/Downloads/CRMdownloads/default.aspx. Accessing Web Services Added new topic that explains how to access the Microsoft CRM Web services from your custom scripts. Callouts: Supported Callouts for Entities Bug fix: removed Route from the list of events for which callouts can be triggered. Callouts: Support for Version 1.2 Post Callouts Added information on enabling version 1.2 post callouts after upgrade to version 3.0. Client Programming Guide: Form Object Model Updated information and samples for:Form Properties Lookup Field Type
Customer Field Type
Date/Time Field Type
Client Programming Guide: IFrame Support Added information about passing parameters to an IFrame. Also added a note regarding support for IFrames in the Outlook Client. CrmDateTime Bug fixes in the description of supported formats for date/time strings. CrmService Entities Completed attribute documentation for all entities. CrmService Enumerations Added state and status reason mapping to all state enumerations.Added values to all enumerations. CrmService Messages Updated sample code for the following messages:ConvertSalesOrderToInvoice RetrieveBusinessHierarchyBusinessUnit
QueryExpression
Dynamic Entity Targets Bug fixes in the Dynamic Entity sample code. Finding the ID of an Entity Instance Added new topic describing multiple ways to find the entity instance ID of a record for use in SDK methods and messages. Helper Code for ISVs Updated the IsvReadiness sample code:Added new types: OnErrorType, PreCalloutType, PostCalloutType. Removed one type: CalloutType.
Added new methods to the CalloutConfigCustomizer class.
How to Work with Lookup Form Controls Added sample code scenario to client side SDK. Mapping from Version 1.2 Added information regarding the deprecated 1.2 methods for uploading attachments. Privileges by Message Added the set of privileges required for each message. Report Development Environment Added information on how to develop reports using a text editor instead of Visual Studio .NET. Retrieve the Status Codes for Account Added a sample demonstrating how to use the metadata Web service to retrieve the possible status codes for the account entity. Sample Code Updated the following code samples:Retrieve the Localized State Name Route an Incident from a User to a Queue
Added new code samples:
Convert a Dynamic Entity to a Core Entity
Security and Impersonation Expanded the description of impersonation. Serializing Callouts Changed example code to work around a memory leak in ASP.NET 1.1. SetStateContract Added information to the SetStateContract message specifying the requirements that must be met to set the state of a contract to Invoiced. Support for Biz Talk 2004 Added section on support for BizTalk 2004. Using CRM Attribute Types Updated information regarding the mapping of types from the CRM application to the SDK types. See also Dynamic Entity Classes. Using Dynamic Entity Bug fixes in the Dynamic Entity sample code. Dynamics CRM 989 views





