Are compound joins possible using FetchXml in Microsoft Dynamics CRM 4.0?

I am using FetchXml to query CRM 4.0. We have a special case that will require a composite connection between CRM-entites. The FetchXml schema indicates that multiple elements of the link-entity element are allowed, and also indicates that several filter / condition elements can be added to the link element. The problem I am facing is that the value attribute of the condition element does not indicate the name of the object / column. He expects an explicitly declared value.

For example, FetchXml allows you to specify this:

<link-entity name='myentity' from='column1' to='column2'/> 

... which is equivalent to T-SQL of this:

 JOIN myentity on column1 = column2 

And it allows you to specify this:

 <link-entity name='myentity' from='column1' to='column2'> <filter type='and'> <condition attribute='column3' operator='eq' value='myvalue' /> </filter> </link> 

... which is the T-SQL equivalent of this:

 JOIN myentity on column1 = column2 AND column3 = 'myvalue' 

FetchXml does not appear, however, to provide an equivalent of this:

 JOIN myentity on column1 = column2 AND column3 = column4 

Pay attention to the difference. FetchXml provides conditions in a join, but it appears to provide a compound join, i.e. a join of several columns.

Has anyone in cyberspace been able to make a compound connection using FetchXml in CRM 4.0? Thanks!

Additional Information:

I am looking for an answer that FetchXml uses to accomplish this, not SQL or QueryExpression syntax. The above SQL should just explain the concept.

+7
dynamics-crm fetchxml
source share
1 answer

No, this does not allow. Fetch XML is pretty limited when it comes to something non-basic in joins. If I'm interested, I usually check my request using Stunnware Tools . If it is not open, this probably cannot be done.

Unfortunately, in situations such as this, I usually end up (imposing) using an approach with multiple requests for the problem.

I know that you said that you are not interested in this, but I am sure that QueryExpression will not cope with this either. In my experience, it offers only a subset of the fetchxml functions.

+6
source share

All Articles