Navigating Hierarchies: Understanding Condition Operators in Dynamics 365

Hierarchical data is like a family tree for businesses. It shows who reports to whom, like in a company where workers have bosses and those bosses have their own bosses. Dynamics 365 has tools to help manage and navigate this kind of data. In this article, we’ll explore these tools in detail.

Let’s begin by understanding what hierarchical data is. Imagine a company chart: workers report to their managers, and those managers report to the top leaders. This creates a layered setup.

You can use the latest query condition tools to search tables that have clear parent-child links. These tools are only for tables set up with a specific hierarchical connection. When you search using QueryExpression or FetchExpression, these new tools can help get the layered data.

FetchXMLConditionOperatorDescription
aboveAboveFetches all records from the lineage above the referenced record.
eq-or-aboveAboveOrEqualRetrieves the specific record and all its ancestral records.
underUnderGets all the descendant records from the referenced one.
eq-or-underUnderOrEqualBrings up the selected record and all its subordinate records.
not-underNotUnderObtains all records except those below the chosen record.
eq-useroruserhierarchyOwnedByMeOrMyReportsIn hierarchical security setups, matches the current user or anyone in their reporting structure.
eq-useroruserhierarchyandteamsOwnedByMeOrMyReportsAndTeamsIn hierarchical security contexts, matches the user, their teams, their reporting lineage, and associated teams.
Use the above operators to set conditions when querying hierarchical data.

Leave a comment