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.
For 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;
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;