In D365/ CRM, Customers always have a common query which goes like this –
How do we list all the Accounts which do not have Any opportunity associated to them, or any contact associated to them?
The requirement is simple, and the customer will hope it is a straight forward advanced find.
But this is not the case. In advanced find, we can design the query to show the Accounts that have one or more opportunities, BUT we cannot design it to show the Accounts that do not have any opportunities.
So, we usually do, a flag or custom development or custom SSRS report to achieve this.
Well, no need to do this Anymore!
With D365 v9 about to release soon, this is possible in Advanced find to achieve the above requirement.
Earlier in Advanced Find, when we select related entity, we did not have any option to filter the related entity. CRM would by default filter to contain the data in related entity.
So, if you select Related Opportunities in account, CRM would consider it as all the Accounts that have 1 or more Opportunity.
With the July release, we can have the option to filter Accounts that do not have any Opportunity. It would look like below:
You can see the new filter option on the related entity to select “Contains Data” or “Does not Contain Data”.
For getting accounts, that have 1 or more opportunity associated, we just have to select “Contains Data” like below:
The above query will return all the Accounts that do not have a single opportunity
We can see a new attribute – “notinvalue” in the link-entity node of Fetch XML, which was not there in earlier release of CRM.
Using this attribute, it has now become simpler for end users as well as Developers to design and perform advanced queries on the data very easy.
Note: As on 5th Sep 2017, this feature is part of preview program.
Check out Microsoft’s documentation for additional information on the July release.