0

I want to create a View For Account entity which will show me the accounts with "No Appointments" as well as the accounts with "No Appointments in Last 6 months".

Actually I need a view which will display those accounts which have no appointments at all as well as those appointments having no appointments since last 6 months.

Is it possible?

Henk van Boeijen
  • 7,357
  • 6
  • 32
  • 42
Ripal Soni
  • 21
  • 3
  • Can you elaborate on how the union of "No Appointments" and "No Appointments in Last 6 months" would be different from just "No Appointments"? Additionally, what have you tried so far? – Henrik H Apr 25 '16 at 13:23

3 Answers3

0

Views in Dynamic CRM are built on FetchXML queries. This query language does support left outer joins, but it is not possible to filter the result set to just the rows where there is no match on the right side.

So, the answer to your question is "no"; given a 1:n relationship it is not possible to create a view showing only rows from the 1-side with no associated data on the n-side.

Henk van Boeijen
  • 7,357
  • 6
  • 32
  • 42
0

Henks answer is incorrect. FetchXML does support this behavior, it just isn't exposed natively in the advanced find. For a full answer please reference this post

Community
  • 1
  • 1
Zach Mast
  • 1,698
  • 1
  • 10
  • 17
0

You can customise your fetchxml to have your requested result.

This should be something like this

    <fetch mapping='logical'>
 <entity name='account'>
  <attribute name='name'/>
  <link-entity name='appointment'
               from='activityid'
               to='accountid'
               link-type='outer'/>
  <filter type='or'>
   <condition entityname='appointment'
              attribute='activityid'
              operator='null'/>
            <filter type="and">
        <condition entityname='appointment' attribute="actualend" operator="last-x-months" value="6" />
        <condition entityname='appointment' attribute="statecode" operator="eq" value="1" />
      </filter>
  </filter>

I didn't tested but that give you what you asked, you can build a custom view with that or manipulate your gridview.

Otherwise you could also use a report to give you this information.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83