Search This Blog

Thursday, April 11, 2013

Enable prefiltering on FetchXML report

I just spent over an hour trying to understand why, all of sudden, something I've always done a certain way seems to NOT work anymore. Ever been there?

I was working on a CRM 2011 report (FetchXML) that I want prefiltered to pick up the selected Invoice records. Should be easy enough, simply add enableprefiltering="true" to the main entity to filter. Right?

Or is it?

For some reason (I was probably recycling a query from somewhere else, as I tend to do), I had given my entity an alias: <entity name="invoice" alias="Inv" enableprefiltering="true" >. The report uploaded to CRM without a hitch, the prefilter ("Advanced Find"-like window) came up to allow me to select filter criteria, but no matter the conditions, the report would NOT filter.

After trying various other options (including eating an ice cream bar, which did nothing for my report performance but made me happier), I removed the alias and ta-da! the filter suddenly works.

You might want to give this a try if you are facing the same issue in a similar context. (I haven't tried to replicate the solution without the ice cream element, so take no chance and go get one!)

~ Brigitte