Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Development: New "Atlas" Videos Released

    Posted on August 26th, 2006 Mitch Milam Print Print No comments

    The Microsoft ASP.NET team has released a new series of videos that show you how to implement various parts of the Atlas framework.

    For those of you who are ASP.NET developers and haven't heard of Atlas, it is Microsoft's framework for integrating AJAX into ASP.NET.

    Check it out, if you have not already.

    Development
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    1,381 views
  • test

    Posted on August 26th, 2006 Mitch Milam Print Print No comments

    test

    Meanderings
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    1,459 views
  • Development: Comparing SQLDMO to SQL SMO

    Posted on August 26th, 2006 Mitch Milam Print Print No comments

    [ So have you ever wondered how many times Microsoft has to create new acronyms?  I bet someone get's paid for every new one they create. :) ]

    Anyway, back to the topic at hand:

    Managing SQL Server Objects

    As I have written about in several articles here on my blog, I have been using SQLDMO to retrieve information from SQL Server and perform various activities that ordinarily I would have to use SQL Enterprise Manager for.

    Today, I wanted to discuss with you an alternative to SQLDMO called SQL SMO, which ships with SQL Server 2005.

    Here is a quick overview of both DMO and SMO:

    SQLDMO:

    • Works with SQL Server versions 7, 2000, and 2005
    • COM based component – not managed code
    • Small footprint
    • Will work with .NET 1.1 and 2.0

    SQL SMO:

    • Designed for SQL Server 2005 but most functionality will work with SQL Server 2000 and SQL Server 7
    • All managaged code
    • Requires .NET 2.0
    • Requires SMO to be installed
    • Requires SQL Server 2005 Native Client
    • Requires MSXML 6.0

     

    Deciding Which to Use:

    Looking at several of the examples on MSDN, it would seem that the SMO libraries are a bit cleaner than DMO and they allow you greater flexibility and functionality. 

    I think you need to take into account the following items when planning your application:

    1. What is my market? Is it SQL Server 2000 or SQL Server 2005?
    2. Do my customers have SQL Server 2005 installed?
    3. If you are writing an add-on for another product, does that product require SQL Server 2000 or SQL Server 2005?
    4. What is your development platform? Visual Studio 2003 or 2005?
    5. How will your application be distributed?
      ( Web, CD, manual installation by an engineer. )

      

    My Decision: 

    But, after looking at all of the requirements, I decided to stick with using DMO until such a time as I encountered a feature of SMO that required me to switch to the new codebase.  As it turns out, most of my customers are running SQL 2Server 000 and will not be switching to 2005 for the foreseeable future.  So, I have a secondary reason for not making the switch.

    Depending on your circumstances, you make take a similar route.  Although I like the idea of having a totally managed code solution, the costs far outweigh the benefits.   For me, requiring the user to download 50+MB of support software just to get my application to load, was more than I could stand.

    In a couple of years, when the SQL Server 2005 market is more fully established, I am assuming I'll be making the switch and rewriting all of my DMO libraries to incorporate SMO features.

      

    References:

    SQL Server and DMO: Distributed Management Objects Enable Easy Task Automation

    SQL Server Management Objects (SMO) 

     

    Development
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    2,960 views
  • Dynamics CRM 3.0: The problem of duplicate email addresses

    Posted on August 26th, 2006 Mitch Milam Print Print 2 comments

    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:

    1. Unzip CRMDupCheck.zip and you will find CRMDupCheck.sql.
    2. Open SQL Enterprise Manager.
    3. Navigate to the MSCRM database.
    4. Open Query Analyzer.
    5. Open CRMDupCheck.sql
    6. Click the Execute button. Assuming you have duplicate emails, the output should look something like this:

     

    Download it here.

    Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    1,711 views
  • Development: Documenting C# functions

    Posted on August 26th, 2006 Mitch Milam Print Print 2 comments

    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:

    1. Unzip InsertDocComments2.zip and you will find the InsertDocComments2.vb function.
    2. Select Tools, Macros, Macros IDE.
    3. In the Project Explorer window, right-click on the tree into which you would like to place this function.
    4. Select Add Existing Item.
    5. Select InsertDocComments2.vb and click OK.
    6. 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 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    1,236 views
  • Release: Utility to generate picklist options for Dynamics CRM 3.0

    Posted on August 26th, 2006 Mitch Milam Print Print 10 comments

    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:

    1. In the text box on the left ( Source ), enter your Picklist Options. One per line
    2. 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.
    3. Click the Generate button to generate the XML.
      Its formatted funny due to the XML CRM requirements, so don't change anything.
    4. Click the Copy to Clipboard button to copy the contents of the Destination text box to the clipboard.
    5. Launch WordPad and open the Customizations exported from CRM.
    6. Locate your picklist and replace the Options with the code generated by this utility.
      ( just highlight it and select Edit, Paste )
    7. Save your customization file.
    8. Import into CRM and Publish Customizations.

    That's it.

     

    Requirements:

    1. .NET 1.1 runtime.

      

    Installation Process:

    1. Unzip the CRMGenOptions.zip file.
    2. 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
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    6,082 views
  • Using SQLDMO

    Posted on August 26th, 2006 Mitch Milam Print Print No comments

    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 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    1,054 views
  • Miss April

    Posted on August 26th, 2006 Mitch Milam Print Print No comments

    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
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    902 views
  • More Popups and Dynamics CRM

    Posted on August 26th, 2006 Mitch Milam Print Print No comments

    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
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    910 views