If-else clause in fetchXml CRM

I want to get data from two tables deal and details. I could make join and fetch data but I couldn’t figure out how to link-entity on a condition. In simple terms, I want

if deal.sell is yes:
    fetch details
else:
    fetch deal

The xml below links and fetches some attributes of details , how can I insert the if else clause to this?(if its possible)

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
  <entity name='deal'>
    <attribute name='createdon' />
    <attribute name='statecode' />
    <attribute name='dealsid' />
    <link-entity name='details' from='detailsid' to='deal_detail' >
       <attribute name='description' />
    </link-entity>
  </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