CRM 2011: Raise Link Entity Limit

When querying CRM data using either QueryExpressions, FetchXML or Linq, you might receive the following error message when joining more that 10 entities:

Number of link entities in query exceeded maximum limit

That is very annoying. Why would they do that? Does Microsoft assume that all CRM consultants are dumb idiots who don’t know what they’re doing and need limits?

Anyway, here’s how to raise the limit from 10 to 20, by adding a row in the DeploymentProperties table of the MSCRM_Config database. This is of course unsupported.

declare @guid uniqueidentifier
set @guid =
(Select top 1 Id From MSCRM_CONFIG.dbo.DeploymentProperties)

— Add row in DeploymentProperties table
INSERT INTO MSCRM_CONFIG.dbo.DeploymentProperties(Id,ColumnName,IntColumn,Encrypted)
VALUES(@guid,’QueryLinkEntityLimit’,20,0)

— Check
select * from MSCRM_CONFIG.dbo.DeploymentProperties where ColumnName = ‘QueryLinkEntityLimit’

Leave a Reply

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