Michael Philip's Blog

Writing about MS Tech with strong focus on Azure & CRM

Perform left outer join using Fetch XML in MS CRM 2013/2015

Leave a comment

This illustration shows you how to use FetchXML queries to perform left outer join.

The following query shows how to query accounts having no leads

<fetch mapping=’logical’>
<entity name=’account’>
<attribute name=’name’/>
<link-entity name=’lead’ from=’leadid’ to=’originatingleadid’ link-type=’outer’/>
<filter operator=’and’>
<condition entityname=’lead’ attribute=’leadid’ operator=’null’/>
</filter>
</entity>
</fetch>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s