How to convert Managed components to Unmanaged

The scenario I encountered involved merging all of the client’s unmanaged components into a single solution and importing this solution into an empty environment. However, I discovered that they also had custom components imported into their Dev environment as a managed solution. This presented dependency issues when attempting to import the single solution into an empty environment. Below, I have outlined the steps I took to resolve this issue.

Steps:

1. Find and export the managed solutions (if possible). It is crucial to have a copy of your managed solutions available for download because you can then copy and paste the XML from your managed solution into your unmanaged solution. If you do not have a copy of your managed solution, the success of converting the managed components into unmanaged decreases significantly. In such a case, you would need to manually write the XML yourself, which is time-consuming and prone to errors.

2. Remove any custom dependencies from the unmanaged solution in the solution.xml that reference the managed solutions. Below is an example of the XML you should remove:

  <MissingDependency>
    <Required type="1" schemaName="bulkoperation" displayName="Quick Campaign" solution="msdynce_Marketing (9.0.4.37)">
      <package>msdynce_MarketingAnchor (9.0.24014.10001)</package>
    </Required>
    <Dependent type="80" schemaName="new_Sales" displayName="Sales" />
  </MissingDependency>

3. Add the Entity metadata of the managed entity under the </attributes> tag and before the </entity> tag. It should look something like the example below:

      </attributes>
      <EntitySetName>pa_capabilities</EntitySetName>
      <IsDuplicateCheckSupported>1</IsDuplicateCheckSupported>
      <IsBusinessProcessEnabled>0</IsBusinessProcessEnabled>
      <IsRequiredOffline>0</IsRequiredOffline>
      <IsInteractionCentricEnabled>0</IsInteractionCentricEnabled>
      <IsCollaboration>0</IsCollaboration>
      <AutoRouteToOwnerQueue>0</AutoRouteToOwnerQueue>
      <IsConnectionsEnabled>0</IsConnectionsEnabled>
      <IsDocumentManagementEnabled>0</IsDocumentManagementEnabled>
      <AutoCreateAccessTeams>0</AutoCreateAccessTeams>
      <IsOneNoteIntegrationEnabled>0</IsOneNoteIntegrationEnabled>
      <IsKnowledgeManagementEnabled>0</IsKnowledgeManagementEnabled>
      <IsSLAEnabled>0</IsSLAEnabled>
      <IsDocumentRecommendationsEnabled>0</IsDocumentRecommendationsEnabled>
      <IsBPFEntity>0</IsBPFEntity>
      <OwnershipTypeMask>UserOwned</OwnershipTypeMask>
      <IsAuditEnabled>0</IsAuditEnabled>
      <IsRetrieveAuditEnabled>0</IsRetrieveAuditEnabled>
      <IsRetrieveMultipleAuditEnabled>0</IsRetrieveMultipleAuditEnabled>
      <IsActivity>0</IsActivity>
      <ActivityTypeMask></ActivityTypeMask>
      <IsActivityParty>0</IsActivityParty>
      <IsReplicated>0</IsReplicated>
      <IsReplicationUserFiltered>0</IsReplicationUserFiltered>
      <IsMailMergeEnabled>1</IsMailMergeEnabled>
      <IsVisibleInMobile>0</IsVisibleInMobile>
      <IsVisibleInMobileClient>0</IsVisibleInMobileClient>
      <IsReadOnlyInMobileClient>0</IsReadOnlyInMobileClient>
      <IsOfflineInMobileClient>0</IsOfflineInMobileClient>
      <DaysSinceRecordLastModified>0</DaysSinceRecordLastModified>
      <MobileOfflineFilters></MobileOfflineFilters>
      <IsMapiGridEnabled>1</IsMapiGridEnabled>
      <IsReadingPaneEnabled>1</IsReadingPaneEnabled>
      <IsQuickCreateEnabled>0</IsQuickCreateEnabled>
      <SyncToExternalSearchIndex>0</SyncToExternalSearchIndex>
      <IntroducedVersion>1.0</IntroducedVersion>
      <EnforceStateTransitions>0</EnforceStateTransitions>
      <EntityHelpUrlEnabled>0</EntityHelpUrlEnabled>
      <ChangeTrackingEnabled>0</ChangeTrackingEnabled>
      <IsEnabledForExternalChannels>0</IsEnabledForExternalChannels>
      <IsMSTeamsIntegrationEnabled>0</IsMSTeamsIntegrationEnabled>
      <IsSolutionAware>0</IsSolutionAware>
    </entity>

4. Next, you need to add the description XML after the <entity Name> tag and before the <attributes> tag. It should look something like the example below:

<entity Name="new_entity">
          <LocalizedNames>
            <LocalizedName description="New Entity" languagecode="1033" />
          </LocalizedNames>
          <LocalizedCollectionNames>
            <LocalizedCollectionName description="New Entities" languagecode="1033" />
          </LocalizedCollectionNames>
          <Descriptions>
            <Description description="New Entity" languagecode="1033" />
          </Descriptions>
          <attributes>

5. Next, you will need to add the attributes from your managed solution XML. It should look something like the example below:

        <attribute PhysicalName="CreatedBy">
          <Type>lookup</Type>
          <Name>createdby</Name>
          <LogicalName>createdby</LogicalName>
          <RequiredLevel>none</RequiredLevel>
        <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid</DisplayMask>
          <ImeMode>auto</ImeMode>
          <ValidForUpdateApi>0</ValidForUpdateApi>
          <ValidForReadApi>1</ValidForReadApi>
          <ValidForCreateApi>0</ValidForCreateApi>
          <IsCustomField>0</IsCustomField>
          <IsAuditEnabled>0</IsAuditEnabled>
          <IsSecured>0</IsSecured>
          <IntroducedVersion>1.0</IntroducedVersion>
          <IsCustomizable>1</IsCustomizable>
          <IsRenameable>1</IsRenameable>
          <CanModifySearchSettings>1</CanModifySearchSettings>
         <CanModifyRequirementLevelSettings>1</CanModifyRequirementLevelSettings>
          <CanModifyAdditionalSettings>1</CanModifyAdditionalSettings>
          <SourceType>0</SourceType>
          <IsGlobalFilterEnabled>0</IsGlobalFilterEnabled>
          <IsSortableEnabled>0</IsSortableEnabled>
          <CanModifyGlobalFilterSettings>1</CanModifyGlobalFilterSettings>
          <CanModifyIsSortableSettings>1</CanModifyIsSortableSettings>
          <IsDataSourceSecret>0</IsDataSourceSecret>
          <AutoNumberFormat></AutoNumberFormat>
          <IsSearchable>0</IsSearchable>
          <IsFilterable>0</IsFilterable>
          <IsRetrievable>0</IsRetrievable>
          <IsLocalizable>0</IsLocalizable>
          <LookupStyle>single</LookupStyle>
          <LookupTypes />
          <displaynames>
            <displayname description="Created By" languagecode="1033" />
          </displaynames>
          <Descriptions>
            <Description description="Unique identifier of the user who created the record." languagecode="1033" />
          </Descriptions>
        </attribute>

6. Next, you will need to add the FormXML and SavedQueries under the </EntityInfo> tag. It should look something like the example below:

</EntityInfo>
<FormXml>
<forms type="main">
          <systemform>
            <formid>{babfbaed-a024-4fa9-85b1-6c9c81866132}</formid>
            <IntroducedVersion>1.0</IntroducedVersion>
            <FormPresentation>1</FormPresentation>
            <FormActivationState>1</FormActivationState>
            <form headerdensity="HighWithControls">
            ...
            <IsCustomizable>1</IsCustomizable>
            <CanBeDeleted>1</CanBeDeleted>
            <LocalizedNames>
              <LocalizedName description="Information" languagecode="1033" />
            </LocalizedNames>
            <Descriptions>
              <Description description="A form for this entity." languagecode="1033" />
            </Descriptions>
          </systemform>
        </forms>
</FormXml>
<SavedQueries>
        <savedqueries>
          <savedquery>

          ...

          </savedquery>
</savedqueries>
      </SavedQueries>
      <RibbonDiffXml>
        <CustomActions />
        <Templates>
          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
        <CommandDefinitions />
        <RuleDefinitions>
          <TabDisplayRules />
          <DisplayRules />
          <EnableRules />
        </RuleDefinitions>
        <LocLabels />
      </RibbonDiffXml>
    </Entity>

Following these steps should guide you through the process of converting managed components into unmanaged components effectively.

Leave a Reply

Your email address will not be published. Required fields are marked *