Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Importing Records and the CRMDeletionService

    Posted on March 27th, 2007 Mitch Milam Print Print No comments

    As you may know, each record within the CRM system has a unique identifier that identifies it within the system. This identifier is know as a GUID, or a Globally Unique ID.

    When you programmatically import records into CRM, you can either supply the GUID yourself, as a item within the import dataset, or you may allow CRM to generate the GUID.

    I was using a modified version of the Bulk Import Utility that I mentioned a while back and for this particular implementation, it made the import much more efficient if I supplied the GUID during the import process. 

    NOTE: In such a case all you do is assign the value of the GUID to the Entity's ID column, such as:

    Lookup keyTestValue = new Lookup();
    keyTestValue.Value = new Guid(myGUID);
    keyTestValue.type = EntityName.contact.ToString();

    This worked great for a while. I would test a section of the import process, delete the imported records, and reimport them later.

    Then I started running to very strange errors:

    Server was unable to process request.

    Not exactly though provoking or even any help at all in leading me to the root cause of the problem.

    The Problem

    It turns out, that even though I had deleted my test import records from CRM, they were still in the database.

    This is a common practice, and in case you didn't know, the CRM Client does not physically delete CRM records – it merely marks them for Deletion.  The CRMDeletionService is the process that runs periodically and makes everything in the CRM world right again.

    Except my CRM world wasn't right at all.  I couldn't continue my development efforts since I couldn't reliably test my import process, I had no idea why it was suddenly broken, and I had people at the customer site waiting on me to finish.

    I finally traced the issue to the fact that I was importing the GUID IDs along with the other Entity data.  I am making an educated guess that CRM was getting upset that it was finding those IDs existing within the database during the Create process and the import for that record was failing.

    I didn't want to result to manually deleting records from the CRM Base tables because that's against the rules, and I had no idea what magic was required to manually fire off the CRMDeletionService to have it do it's job.

    So I did what I usually do in cases like this: I sent a panicked email to a couple of my fellow CRM MVPs for thoughts and ideas.

    The Solution

    Michael Höhne came to my rescue with a bit of CRM knowledge that I am sharing now.  It turns out that you can instruct the CRMDeletionService to run manually, using the following instructions:

    1) Open a command prompt.

    2) Change your directory to: [CRM installation directory]\server\bin

    3) Run crmdeletionservice –runonce

    That will run the CRMDeletionService which will remove the deleted records from the database.

    CRM Deleted Records Backgrounder

    As mentioned above, the CRM client is not actually the process that deletes CRM records, it is the CRMDeletionService that does the actual work.  This is probably due to the fact that Delete operations are fairly intensive processes and due to the Entity Relationships you find within CRM, it can be extremely complex and time consuming.

    Rather than burden the user with this effort, the CRM Client merely updates the individual records and changes the DeletionStateCode to a value of 2.  The CRMDeletionService wakes up on a periodic basis ( unknown and not documented, BTW ), and deletes any record with the DeletionStateCode of 2.

    This makes for a fairly efficient system and an overall better user experience.

    Should you be accessing CRM data via the SQL Filtered Views, the DeletionStateCode value is taken into account and records marked for deletion are not returned.

    Likewise, the CRM Clients both mirror this functionality and totally ignore records marked for deletion.

    Future Development Efforts

    One of the first CRM add-ons I ever wrote was a utility that performed a bulk delete of CRM data, using the CRM WebService APIs.  Unfortunately, it doesn't always function as expected and I haven't had the time to invest into tracking down the issues relating to the failure of the CrmService.Delete call.  I think most of these issues are related to relationships and cascading issues.

    I will also be adding an option to physically delete the records marked for deletion by running the CRMDeletionService -runonce.  That will be a valuable edition.

    It may also be possible to create an Undelete utility for CRM but I have no idea if you can "legally" set the DeletionStateCode back to 0 through the CRM Web Services.  There will also be tons of issues related to relationships and cascading behaviors that need to be taken into account.  All of which means it may not possible, or practical to create such a utility.

    Development, Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    3,355 views
  • Introduction to the CRM SBE Configuration Wizard

    Posted on December 11th, 2006 Mitch Milam Print Print 2 comments

    Dynamics CRM 3.0 ships with a Configuration Wizard that allows you to configure most of the common customization points automatically.  It builds a configuration file that can either be saved for later Import or Imported live.

    Where to find it:

    Look in the following folder on your CRM Server:

    [installation drive]\Program Files\Microsoft CRM\Tools\

    The application file name is:

    Microsoft.Crm.Sbe.Configuration.Wizard.exe

    Launching the wizard will step you through a process that begins with the following dialog:

    You can select the Primary Industry of your company, which will provide answers to later questions.

    The following Industries are currently provided:

    Financial Services
       Banking
      Insurance
    Government
    Healthcare
      Health Plan Payer
      Healthcare Provider
    Life Sciences
      Pharmaceuticals
    Manufacturing
      Discrete Manufacturing
      Process Manufacturing
    Media and Entertainment
      Advertising
      Entertainment
    Nonprofit
    Professional Services
      Real Estate
      Management Services
      Engineering and Architecture
      Legal
    Retail
    Telecom
      Communication Service Providers
      Equipment Providers
      Network, Internet or Applications Service Providers
    Transportation and Logistics
    Utilities

     

    The subjects provided will be automatically populated based on your Industry choice.  As you can see, you can Add, Remove, and Edit existing items.

    When you define your Sales Operations information, you will allowed to set the display name format for the contact names within CRM as well as change the names of the Account and Contact Entities.

    If you utilize territories in your business, you will be allowed to enter those as well.

    You can also define your Top Competitors.

    Should you use the CRM Services module, you can change specific settings for that as well.

    And define your Service Sites.

    And Service Queues.

    Finally, you may either apply your changes immediately, or wait until a later time.  Should you choose Later, you will be allowed to specify a file name that will be used to store the settings ( in XML format ) that will be used by the Configuration Wizard to apply your changes.

    In order to start the Configuration Wizard and instruct it to use the XML configuration file you created earlier, you must execute the Configuration Wizard from the command line and specify the name of the configuration file, as is shown below:

    The config file will be read and a summary of your specific group of settings will be displayed.

    You will then be asked to enter the location for your CRM server.

    When you click next on the above dialog, the Configuration will begin the Import process, as shown below:

    As you can see, any configuration sections that didn't contain data were skipped. The other messages indicate if that part of the process Succeeded or Failed.

    Clicking Finish will close the Wizard.

     

    Related Items of Interest:

    The SBE Configuration Wizard is launched at the end of the CRM SBE installation, but you can cancel it and run it later.

    Even though the Wizard is titled "SBE", you may also run the Wizard on a CRM Professional installation ( all of the above screen shots are from my development system, which is CRM Professional ).

    The configuration file created by the Wizard is to only be used by the Wizard to implement your changes. It is not in a format that is compatible with the CRM Customizations Import process.

    I know of no method of adding information to the Wizard to add additional Industries, etc., so we're pretty much stuck with what Microsoft delivers.

    Customization, Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    2,806 views
  • Driving Dynamics CRM 3.0 User Adoption

    Posted on September 27th, 2006 Mitch Milam Print Print 1 comment

    Gaining user acceptance and adoption of Dynamics CRM can, of course, be greatly increased with proper instruction and training.

    I have begun to notice a pattern in acceptance should you be installing CRM into an organization that does not currently utilize Outlook, or uses it minimally.

    If the user isn't familiar and comfortable with Outlook, installing the CRM Outlook client can confuse the heck out of them.  This is caused by the fact that once the Outlook client is installed, the user now has at least two different methods to do many things.  And, if they don't know where Outlook ends, and where the CRM client begins, it can lead to more than a little bit of frustration as they attempt to determine the correct way to do something.

    But doesn't everyone use Outlook?

    Not as much as you think, especially in smaller organizations, and especially if they don't have Exchange installed. Either they use Outlook Express for email or use Outlook and then, only for email.  That means that things many of us take for granted, like: Contacts, Scheduling, and Shared or Group Calendars are totally new and different.  New and different many times is translated into "scary" and scary is bad.

    Working through the issues

    Here is one approach that I think will work in many organizations who make little or no use of Outlook.

    1) Take time to know and understand the product knowledge-level of user community.

    2) Perform a phased implementation and get the user working and productive with Outlook before CRM is implemented.

    3) Have you or your staff be physically present during this initial phase so that people can ask stupid and embarrassing questions.

    Note: There are no such things as stupid and embarrassing questions, but people still think they exist.

    4) Perform a simple, quarter or half-day group training session so people can get an exposure to the product.

    5) Engage with the users one-on-one, to provide personalized responses to questions and issues. 

    People will generally react much better to personal coaching than group training and will tend to ask better and more questions when outside of the group setting.

    6) By this point you have probably finished your CRM installation, configuration, and customization activities and it is now time to roll-out the CRM Outlook client.

    7) Repeat steps 3 through 5 and outline the differences between Outlook and CRM and discuss in detail how the two products work together.

    8) Have users keep a notepad to document questions and concerns as they use the system.

    9) Perform frequent visits to each user's office to review and address any questions and concerns they may have document in their notepad.

     

    While these steps may not handle everything you encounter, I think it covers most of the issues that I've seen in the past couple CRM implementations.

    If you have experiences of your own that you would like to share, please leave a comment.

    Dynamics CRM, Installation, Outlook Client
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    2,537 views
  • Creating a Team in Dynamics CRM 3.0

    Posted on September 7th, 2006 Mitch Milam Print Print 1 comment

    One of the things that I recently started adding to my CRM installation process was to create a team called Everyone.

    And why, do you ask, do we need a team called Everyone?  Well, it's rather simple. It is less maintenance in the long run to assign shared records within CRM to a Team, than it is to assign them to individual users.

    Here is how the Team creation process works:

    Creating the Everyone Team:

    1) From the CRM Web Client, select Settings, Business Unit Settings, Teams.

    2) Specify the Team Name as Everyone and give it a Description, as shown below:

    3) Click the Save button.

    4) Under Details, Click Members.

    5) Click the Add Members button.

    6) Enter any search criteria you wish, or leave the Look for: box blank.

    7) Click the Find button to display CRM users that match your criteria.

    8) Select the users you would like to add to the group ( generally all of them ) and click the >> button.

    9) Click OK.

    10) When you are returned to the Member List, click the Save and Close button.

     

    That is how you create a Team in Dynamics CRM 3.0.  In the next article we'll discuss how to utilize our newly created team.

    Customization, Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    2,011 views
  • Dynamics CRM 3.0: Reinstalling the CRM Server

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

    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 )

    1. Open SQL Server Enterprise Manager
    2. Expand Management
    3. Expand SQL Server Agent
    4. Click on Jobs
    5. 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
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    2,069 views
  • Popups, Popups, Popups

    Posted on July 17th, 2006 Mitch Milam Print Print 1 comment

    I got burned ( or actually slightly toasted ) by popup blockers that were keeping CRM from functioning properly.

    I encountered it on one of my test boxes after installing the Google toolbar and at a new customer after installing Trend Micro's solution.

    At last count the following vendors and technologies had some form of pop-up blocker:

    • Internet Explorer ( SP2 )
    • MSN Toolbar
    • Google Toolbar
    • Yahoo Toolbar
    • Trend Micro anti-everything
    • Symantec anti-everything
    • [ and I am sure McAfee falls into that as well ]

    So the lesson learned here is to always keep in mind that pop-up blockers can come from anywhere and you need to keep on top of it. Especially if you are in a situation where you may not be in control of the systems or systems software.

     

    Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    1,834 views
  • Dynamics CRM 3.0: Adding a user-friendly CRM URL

    Posted on July 16th, 2006 Mitch Milam Print Print 2 comments

    As you probably know by now, if you instructed the CRM installation application to create a new web site on which to host CRM, it will assign it the port 5555, which requires the users to type in a fairly complicated URL to access CRM: http://myserver:5555.

    This exercise will solve that problem by creating a standard URL called CRM.

    On the CRM Server, perform the following steps:

    1) Open Internet Information Services Manager.

    2) Double-click on the Web Server's name.

    3) Double-click on Web Sites.

    4) Right click on Microsoft CRM v3.0 ( which should be your CRM web site ).

    5) Select Properties to display the web site properties dialog:

    6) Click the Advanced button to display the Advanced Web Site Identification dialog:

    7) Click the Add button to display Add/Edit Web Site Identification dialog.

    8) In the TCP Port edit box, enter 80.

    9) In the Host Header value edit box, enter crm. The dialog should look like:

    10) Click OK, three times, then exit IIS Manager.

    11) Launch the DNS Management console.

    12) Double-click your main DNS server.

    13) Double-click Forward Lookup Zones

    14) Right-click your domain's internal address name.

    15) Select New Alias (CNAME).

    16) In the Alias name edit box, enter crm.

    17) In the Fully qualified domain name edit box, enter the full path to your CRM Server, like this:

    18) Click Ok.

    19) Right-click on your main DNS Server name.

    20) Select Clear Cache.

    21) Close the DNS Manager.

      

    That is pretty much it.

    Final Note: You need to add http://crm to the Local Intranet zone for all CRM workstations. This can be done manually, or though an Active Directory Group policy.

     

    Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    3,925 views
  • Dynamics CRM 3.0: Exchange Server Setup

    Posted on July 16th, 2006 Mitch Milam Print Print 1 comment

    The Microsoft Dynamics CRM team had a good article on the proper setup of Outgoing CRM email.

    One additional step that needs to be performed if your Exchange Server is not on the same physical computer as CRM is to instruct the Exchange SMTP service to allow the CRM server to Relay outbound email through it.

    Note: These steps mostly apply to CRM Professional installations where you are have decided to use a different server other than the CRM server to send outbound email.

    A CRM SBE will have everything on one server so for normal SBE installations, this will not be an issue.


    Background:

    As a security measure, Exchange 2003 does not allow other servers to relay SMTP email though its SMTP server unless specifically instructed to do so. This prevents unauthorized email traffic that can turn your Exchange server into a SPAM host.

    The Procedure: 

    From the Exchange Sever, start the Exchange System Manager application and follow these steps:

    1) Double-click on Servers
    2) Double-click on the Exchange Server
    3) Double-click Protocols
    4) Double-click SMTP
    5) Right-click on Default SMTP Virtual Server
    6) Select Properties
    7) Click the Access Tab
    8) Click the Relay button
    9) The Only the list below radio button should be checked, as shown below:

    10) Add your CRM server's TCP/IP address to the list of Computers that are Granted Access.
    11) Click OK.
    12) Test by sending an email from the CRM web client to one of your test contacts.

    If you don't follow this procedure, the Exchange Server will simply ignore any outbound SMTP email from the CRM Server and no one will be notified.

    Final Note:

    If email is still not flowing, make sure your Exchange Server ( the computer account, itself ) is part of the PrivUserGroup that CRM created within Active Directory.

     

    Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    6,445 views
  • Dynamics CRM 3.0 Installation Notes

    Posted on June 1st, 2006 Mitch Milam Print Print No comments

    When you install CRM 3.0, the installation logs are written to a directory under the installation user's Documents and Settings directory:

    C:\Documents and Settings\[user]\Application Data\Microsoft\MSCRM\Logs

    You should make a backup of these files because they contain a ton of information related to the choices made during the setup process. 

    Basically, every question you answered during Setup, including the product key, is written to those logs and should you ever need to recover or recreate an installation, that information will come in handy.

     

    Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3.00 out of 5)
    Loading ... Loading ...
    2,012 views