Missing CRM Explorer in Visual Studio 2012

Some people have reported that opening a CRM project in Visual Studio 2012 that has not been connected to a CRM organisation causes the CRM Explorer window not to load when the project is loaded as well as there being no option to show it from the VIEW menu and no option to Connect To Dynamics CRM Server in the TOOLS menu. There seem to be several causes of this behavior, the most common of which being the failure to set the CRM organisation when creating the project.

The problem seems to be that there is a missing section in the visual studio solution file. To fix the issue, follow the process below:

  1. Close the Visual Studio project
  2. Open the Visual Studio Solution file in a text editor such as notepad.
  3. Find the Global section and insert the highlighted section below at the beginning of the section

    Global
        GlobalSection(CRMSolutionProperties) = preSolution
            SolutionIsBoundToCRM = True
        EndGlobalSection
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
            Debug|Any CPU = Debug|Any CPU
            Debug|Mixed Platforms = Debug|Mixed Platforms
            Debug|x86 = Debug|x86
            Release|Any CPU = Release|Any CPU
            Release|Mixed Platforms = Release|Mixed Platforms
            Release|x86 = Release|x86
        EndGlobalSection
    EndGlobal
        
  4. Save the file.
  5. Open the Visual Studio project.
  6. If all has gone to plan, the Connect To Dynamics CRM Server dialog will now pop up and ask you to connect to your CRM Organisation.
Advertisements

CRM2011 Field Data Type Converter

Download: CRM 2011 Field Data Type Converter (1.0.4926.18530)

When trying to import a solution into CRM 2011, if you try import a field with the same name as an existing field but with a different data type, you will receive the following error.

Attribute <Attribute Name> is a <Existing Data Type>, but a <Import Data Type> type was specified.

Usually this happens when attempting to convert a field to a different type. In an environment where there is no data that cannot be lost, this is usually not an issue as one can simply

  1. Delete the existing attribute
  2. Import the solution again

In a production environment or an environment where data cannot be lost, this is not so simple as step 1 above will result in all data in the field being lost.

Enter the CRM2011 Field Data Converter…

The CRM2011 Field Data Converter does the following:

  1. Accepts a CRM Url and credentials, an entity and field, a destination type and various type specific parameters.
  2. Checks whether the supplied entity and field exist and what the field’s existing type is.
  3. Checks whether the source field can be converted to the destination type (see Conversions).
  4. Backs up the existing data.
  5. Deletes the source field.
  6. Creates a new field with the same name and new data type using the supplied type specific parameters.
  7. Populates the data back into the field (converted to the new type – see Conversions).
  8. Outputs a file listing the failures (conversion failures, save failures)

The CRM2011 Field Data Converter DOES NOT do the following:

  • Recover from catastrophic failures: As the data is backed in “in memory”, if a server, network or SQL instance goes down after storing the data and deleting the field, the DATA WILL BE LOST. BACK UP YOUR CRM DATABASE BEFORE RUNNING THIS TOOL.
  • Delete dependencies on the source field: If the source field cannot be deleted manually within CRM, it cannot be deleted by this tool. All dependencies on the field (forms, views, etc) must be manually removed before the tool is run and put back afterwards.

Conversions
  Destination
Boolean DateTime Decimal Double Integer Memo Money String
Source Boolean   * * * * * * *
DateTime   * *
Decimal * *   * * * * *
Double * * *   * * * *
Integer * * * *   * * *
Memo * # * * *   * *
Money * * * * * *   *
String * # * * * * *  
Key
* Convert.To<Type>(sourceValue, CultureInfo.CurrentCulture)
# DateTime.ParseExact(sourceValue, %/datetimepattern%, CultureInfo.CurrentCulture)