Dynamics 365 9.0 supports “Not In” \ “Does Not Have” type of queries as an OOTB feature in Advanced Find. In previous versions of Dynamics 365 had no this feature but there were some custom solutions to facilitate this problem.
The problem in previous versions :
This post (“Not In” \ “Does Not Have” Query in Dynamics CRM – By Cobalt) explains the problem and it describes a solution for the problem for previous versions.
The solution in 9.0 :
The scenario is to query all the accounts which have no cases under in each account. Following query returns the expected results using advanced find without installing any third party components.
“Does Not Contain Data” Clause
The above advanced find query doesn’t allow users to select any more attributes from the cases as it looks for accounts which have no cases. It’s very logical to restrict the user to filter values from the cases when “Does Not Contain Data” option is selected.
“Contains Data” Clause
“Contains Data” clause allows user to filter more attributes in the Case record. The above query is to get all the Accounts which have Cases having Case Number like “CAS”.