Tip #857: Missing component id {0} error when publishing customizations

Today’s tip comes from Daryl “Always Raising” LaBar. (And you can submit your tips too by emailing them to jar@crmtipoftheday.com.)

I recently had the issue described here when publishing customizations. It results in the error message “There was an error calculating dependencies for this component. Missing component id {0}.”

In case anyone hits this error… it was due to the CustomControlDefaultConfig having a PrimaryEntityTypeCode that did not exist in the importing solution.

Before importing the solution, comment the following section out of the customization.xml:

<CustomControlDefaultConfig>
  <PrimaryEntityTypeCode>
    10062
  </PrimaryEntityTypeCode>
  <CustomControlDefaultConfigId>
    {fd3352f1-08a5-e611-80e4-fc15b4286cb8}
  </CustomControlDefaultConfigId>
  <ControlDescriptionXML>
    <controlDescriptions />
  </ControlDescriptionXML>
  <IntroducedVersion>
    1.0.0.0
  </IntroducedVersion>
</CustomControlDefaultConfig>

Or if you have orphan custom control records in your database (and are on premises), you may have to execute this type of SQL:

--***************************
--* TEMPLATE VERSION
--* Created on: 2017.04.04
--* Created By: begarza
--* LI/SR: 117040315545074
--* DESC: Clean up orphan records from 
--*       the CustomControlDefaultConfigbase 
--*       table
--*
--* REVIEW/APPROVAL
--* - RUN/CSS Team: sasing
--* - DEV Team: no need (org DB only)
--***************************

BEGIN TRY
BEGIN TRAN t1

-- Checking if we are on the right Org

Declare @OrgId as Uniqueidentifier
Set @OrgId = '$(Orgid)'

select * from Organizationbase ob (nolock) 
where ob.OrganizationId = @OrgId

If @@ROWCOUNT <> 1 THROW 55000, 
  'OrganizationId does not match!',1;

-- Remove Orphan records from the 
-- CustomControlDefaultConfigbase table
delete from CustomControlDefaultConfigBase 
where PrimaryEntityTypeCode = 10062

COMMIT TRAN t1
PRINT 'EXECUTION SUCCEED'

END TRY

BEGIN CATCH

ROLLBACK TRAN t1
PRINT 'EXECUTION FAILED :' + ERROR_MESSAGE()

END CATCH

Leave a Reply

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