locked
Checking if a related record exists in the critera for a view in CRM 2011. RRS feed

  • Question

  • I have a entity (call it A) that has a many N:1 relations with entity B.  My question is how can I create a view that will show me all records where entity B is not connected to A? 

    If it is not possible in a view can I do it in a report and how?


    Thanks, Dale

    Friday, September 13, 2013 7:41 PM

All replies

  • Build a view on Entity B.

    If Field X is the field on entity B that contains the reference to Entity A, add a filter Field X Does Not Contain Data


    Friday, September 13, 2013 8:30 PM
  • Dale,

    You can do that in a view.

    When you have N:1 relationship from A (Primary entity = B; Related entity=A) , then you will have a lookup of B in entity A.

    You can then create a view in A with a filter condition (Lookup B -> Does not Contain Data). This will give you all records of A that are not connected to B.

    However, iF you want all records of B then it is not possible using a view. Instead you can make a SSRS report using a query like below. (note that I have added the query to just give you an idea. You may want to try it out in SQL first)

    Select * from filteredA where Aid NOT IN ( select Aid from filteredA A, filteredB B where A.Bid= B.Bid)

    HTH


    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    Friday, September 13, 2013 9:09 PM