The Advanced Find functionality within D365 v9 allows us to search for records that have no data in a related entity – a NOT IN query. For example, provide a list of Contacts that are not the Primary Contact for an Account.
However, if we try to create the same using a System View there is currently no option to do a NOT IN query.
To create a System View which contains a NOT IN query I had to complete the following steps.
- Create a basic System View with the required column layout and Publish the View.
- Using XrmToolBox and the View Designer Plugin I opened the System View and edited the query (using FetchXML Builder)
- Finally, save and publish the changes to the System View.
A few things I have found when creating NOT IN System Views.
-
- The System View does get created in the list of System Views for the entity and displays the correct content.
-
- When you open the Advanced Find from the System View, the filters for the System View are displayed correctly but the name of the System View we created is not listed.
-
- When you re-open the System View in the D365 solution after you have made the NOT IN modification, the option to Edit the filter criteria is no longer available. Any additional changes to the System View would need to be made using the XrmToolBox View Designer Plugin.