Cannot assign ownership of entities to users in CRM 2013

I recently dealt with an issue in a CRM2013 organisation that had been upgraded from CRM3, to CRM4, to CRM2011 and eventually to CRM2013 where users were unable to assign ownership of Accounts and Contacts to users. When accessing the assign functionality through the ribbon or the owner field on the form, the Look for field is disabled and there is no way to assign the record to a user.
Look for control disabled

After investigating several dead-ends, I compared the XML of the account entity from an organisation created in CRM2013 and the one that had been upgraded over the years and discovered the following suspicious sections in the upgraded organisation:

<attribute PhysicalName="OwnerId">
  <Type>owner</Type>
  <Name>ownerid</Name>
  <LogicalName>ownerid</LogicalName>
  <RequiredLevel>systemrequired</RequiredLevel>
  <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
  <ImeMode>auto</ImeMode>
  <ValidForReadApi>1</ValidForReadApi>
  <ValidForCreateApi>1</ValidForCreateApi>
  <IsCustomField>0</IsCustomField>
  <IsAuditEnabled>1</IsAuditEnabled>
  <IsSecured>0</IsSecured>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <LookupStyle>single</LookupStyle>
  <LookupTypes>
    <LookupType id="00000000-0000-0000-0000-000000000000">9</LookupType>
  </LookupTypes>
  <displaynames>
    <displayname description="Owner" languagecode="1033" />
  </displaynames>
  <Descriptions>
    <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
  </Descriptions>
</attribute>
<EntityRelationship Name="owner_accounts">
  <EntityRelationshipType>OneToMany</EntityRelationshipType>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <ReferencingEntityName>Account</ReferencingEntityName>
  <ReferencedEntityName>Owner</ReferencedEntityName>
  <CascadeAssign>NoCascade</CascadeAssign>
  <CascadeDelete>NoCascade</CascadeDelete>
  <CascadeReparent>NoCascade</CascadeReparent>
  <CascadeShare>NoCascade</CascadeShare>
  <CascadeUnshare>NoCascade</CascadeUnshare>
  <ReferencingAttributeName>OwnerId</ReferencingAttributeName>
  <RelationshipDescription>
    <Descriptions>
      <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
    </Descriptions>
  </RelationshipDescription>
  <field name="ownerid" requiredlevel="systemrequired" imemode="auto" lookupstyle="single" lookupbrowse="0" lookuptypes="9">
    <IsSecured>0</IsSecured>
    <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
    <IsAuditEnabled>1</IsAuditEnabled>
    <displaynames>
      <displayname description="Owner" languagecode="1033" />
    </displaynames>
  </field>
</EntityRelationship>

The two sections above filter the lookup types of the ownerid field to 9 (Team) and completely exclude 8 (User). After updating the sections above in each entity I was experiencing the problem with to match the same sections from the organisation that was created in CRM2013 (see below) and re-importing, the Look for control now contains both User and Team and allows selection of either.

<attribute PhysicalName="OwnerId">
  <Type>owner</Type>
  <Name>ownerid</Name>
  <LogicalName>ownerid</LogicalName>
  <RequiredLevel>systemrequired</RequiredLevel>
  <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
  <ImeMode>auto</ImeMode>
  <ValidForReadApi>1</ValidForReadApi>
  <ValidForCreateApi>1</ValidForCreateApi>
  <IsCustomField>0</IsCustomField>
  <IsAuditEnabled>1</IsAuditEnabled>
  <IsSecured>0</IsSecured>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <LookupStyle>single</LookupStyle>
  <LookupTypes>
    <LookupType id="00000000-0000-0000-0000-000000000000">8</LookupType>
    <LookupType id="00000000-0000-0000-0000-000000000000">9</LookupType>
  </LookupTypes>
  <displaynames>
    <displayname description="Owner" languagecode="1033" />
  </displaynames>
  <Descriptions>
    <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
  </Descriptions>
</attribute>
<EntityRelationship Name="owner_accounts">
  <EntityRelationshipType>OneToMany</EntityRelationshipType>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <ReferencingEntityName>Account</ReferencingEntityName>
  <ReferencedEntityName>Owner</ReferencedEntityName>
  <CascadeAssign>NoCascade</CascadeAssign>
  <CascadeDelete>NoCascade</CascadeDelete>
  <CascadeReparent>NoCascade</CascadeReparent>
  <CascadeShare>NoCascade</CascadeShare>
  <CascadeUnshare>NoCascade</CascadeUnshare>
  <ReferencingAttributeName>OwnerId</ReferencingAttributeName>
  <RelationshipDescription>
    <Descriptions>
      <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
    </Descriptions>
  </RelationshipDescription>
  <field name="ownerid" requiredlevel="systemrequired" imemode="auto" lookupstyle="single" lookupbrowse="0" lookuptypes="8, 9">
    <IsSecured>0</IsSecured>
    <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
    <IsAuditEnabled>1</IsAuditEnabled>
    <displaynames>
      <displayname description="Owner" languagecode="1033" />
    </displaynames>
  </field>
</EntityRelationship>

So, to summarise the fix for the issue:

  1. Create a solution with the entities that do not allow assignment to users.
  2. Export the solution.
  3. Extract the solution.
  4. Open customizations.xml.
  5. For each entity, replace the sections in Example 1.1 and Example 1.2 with the sections from Example 2.1 and Example 2.2 respectively.
  6. Zip the customisation files up again.
  7. Import the customisation zip file.
  8. Publish the customisations.
  9. Sit back and enjoy a Look for control that allows selection of users again:

Look for fixed

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.