DYNAMICS 365 V9 ADVANCED FIND ASSOCIATION WITH OPERATOR DOES NOT CONTAIN DATA

One of the interesting feature that Microsoft added in D365 V9 is Contains Data & Does Not Contain Data options in the Advanced Find related records.

The purpose of this feature is to have the ability to search for records that are not related to child records. For example: Accounts with no Cases, Contacts with no Tasks... and any other similar needs.

In previous CRM versions, we were not able to do this directly in the Advanced Find; but now, it is feasible and so easy through Advanced Find.

  1. Example 1 (Contains Data): Show all Accounts that have Cases linked to them
    • In D365 V9 environment, open the Advanced Find
    • Select Accounts in the Look for option
    • Under the Fields section, select any field to filter the accounts if needed
    • Scroll down to the Related section and select Cases
    • When you selected the Cases entity, you notice the new drop down displayed to the right with the two options Contains Data & Does Not Contain Data. For this example, choose the option Contains Data
    • When you choose the Contains Data options, you will be able to add all the needed filters against the related record as always been done
    • You can verify what type of relation this query generates by clicking Download Fetch XML in the header and checking the link-type attribute. In this example, the link-type will be inner
    Advanced find 1

    Advanced find 2

  2. Example 2 (Does Not Contain Data): Show all Accounts that don't have Cases linked to them
    • In D365 V9 environment, open the Advanced Find
    • Select Accounts in the Look for option
    • Under the Fields section, select any field to filter the accounts if needed
    • Scroll down to the Related section and select Cases
    • For this example, choose the option Does Not Contain Data. You will notice that you will not be able to add any filter to the Cases entity part of the query
    • You can verify what type of relation this query generates by clicking Download Fetch XML in the header and checking the link-type attribute. In this example, the link-type attribute will be outer
    Advanced find 3

    Advanced find 4

Limitation:
Since we cannot add any condition to the related entity when we choose the option Does Not Contain Data, we will not be able to create queries such as Accounts without Low Priority Cases.


Hope This Helps!

Comments

Popular posts from this blog

DYNAMICS 365 HOW TO HIDE RECENT RECORDS FOR LOOKUP FIELD IN UCI

SEARCH BY GUID IN DYNAMICS 365

SAVE FORM IN DYNAMICS 365 JAVASCRIPT