Tag Archives: Advanced Find

Dynamics CRM 2015 – The Under Operator

Advanced Find now includes two new operators which work in conjunction with the new hierarchies feature in Dynamics CRM 2015. These operators are called “Under” and “Not Under” and can be used when querying lookup fields in Advanced Find.

clip_image002

I have currently set up the Users in our CRM system such that the Manager for each user has been specified. This builds a user hierarchy in the system so we can easily see who reports to who. Let’s assume we have an organisational structure where there are multiple managers at different levels.

clip_image003

It would be a tricky in previous versions of CRM if I wanted to build a query to show everyone who sat below Bob Jones. In CRM 2015, I can simply use the “Under” operator to find these people.

clip_image004

Running this query gives me everyone who sits below Bob Jones, whether they are a direct relationship with that record or not.

clip_image005

New Condition Operators in Dynamics CRM 2015

With the introduction of the new hierarchies feature in Dynamics CRM 2015 comes new condition operators that can be used with the ConditionOperator enumeration in the C# SDK as well as FetchXML queries. These new operators are intended to support records that are related via the new Hierarchies feature of CRM 2015. Some operators include recursion limits to mitigate performance issues when running queries.

Above

Returns all records above the referenced record in the hierarchy. The FetchXML equivalent is above. This query has a recursion limit of 100.

AboveOrEqual

Returns the referenced record and all records above it in the hierarchy. The FetchXML equivalent is eq-or-above. This query has a recursion limit of 100.

Under

Returns all records under the referenced record in the hierarchy. The FetchXML equivalent is under. This operator has a recursion limit of 10.

UnderOrEqual

Returns the referenced record and all records below it in the hierarchy. The FetchXML equivalent is eq-or-under. This operator has a recursion limit of 10.

NotUnder

Returns all records not below the referenced record in the hierarchy. The FetchXML equivalent is not-under. This operator has a recursion limit of 10.

Important: Please note that this blog was written during the Dynamics CRM 2015 Preview Release Program. At the time of writing, only the Under and Not Under operators were available inside Advanced Find, so this may change with the final release. Also note that the OData endpoint has not been updated to support querying of hierarchical data.

clip_image001

Dynamics CRM 2015 – Global Advanced Find

You asked for it and Microsoft has listened! Dynamics CRM now provides the ability to launch the Advanced Find window from anywhere within the application.

clip_image002

Previously, the Advanced Find button was only available on the command bar (or in the overflow menu) on forms and views which was a bit of a nuisance and required a few clicks just to launch it.

An important thing to note is that when you launch Advanced Find from a form, it opens in a separate window with no minimise or restore buttons. You also cannot click back onto the main window to navigate back to the form.

clip_image004

Launching Advanced Find from within a view yields a different result. The window that opens allows the user to minimise and restore.

clip_image006

Having Advanced Find globally available is one of my personal favourite features of the new release. Stay tuned for more new features in Dynamics CRM.