Working with Report Pre-Filtering for related entities using Fetch XML

By | October 9, 2017

Introduction:

Pre-filtering is one of the most important and useful features of reports in Microsoft Dynamics CRM.

Pre-filtering allows filtering of the report data using the Advance Find functionality and enables users to create context-sensitive reports and return more relevant data.

Pre-filtering passes the set of selected record or a specific record (such as Quote) for which the report is being run in such a way that the report is executed and the data is pulled from the context of the current (or selected) record.

Working with Report Pre-Filtering for related entities using Fetch XML:

Pre-filtering can also be applied to related entities.

In the below screenshot, we are retrieving Opportunity and have applied pre-filtering for both Opportunity and Account.

Working with Report Pre-Filtering for related entities using Fetch XMLFor example, we have created two Opportunities for respective Accounts, and when we execute the report (using the above Fetch XML) for records from both the entities, we get the same result as shown in the screenshot below;

Working with Report Pre-Filtering for related entities using Fetch XMLWe also created an additional Opportunity and Account that are not related and hence they were not displayed in the report result.

Note: Pre-filtering does not work for outer join, and the result will be displayed differently for the same report discussed above.

Now after adding an outer join to the Account with Opportunity, the pre-filtering won’t work for Account.

When the report is executed for selected accounts, it will display all opportunities (and would not consider the selected Accounts) as seen in the screenshot below;

Working with Report Pre-Filtering for related entities using Fetch XMLWhen the report is executed for selected opportunities, it will display all the selected opportunities as shown in the screenshot below;

Working with Report Pre-Filtering for related entities using Fetch XMLHope this helps!

Easily Export and Email Dynamics 365 Reports in PDF, Word, or Excel

Leave a Reply