CRM 2011 CRMAF Excludes Records That Are Expected RRS feed

  • Question

  • I have a very simple query (below) using CRMAF. When I run the SSRS report, I expected to get a result of 14 records but I get 13. If I remove the AS CRMAF_FilteredAct_application, it returns all 14 records.  When I look at the 1 record that is not being returned, all of the criteria is met but the CRMAF has filtered it out.  Why would the prefiltering exclude a record? 

    /**************The declaration is used for SQL Server purposes***********/

    declare @actor nvarchar(4000), @startdate date, @enddate date, @currentStatus nvarchar(4000)
    set @actor = 'Wilma Flintstone'
    set @startdate = '2016-04-22'
    set @enddate = '2016-04-22'

    SELECT statuscodename, statecode, applicationnumber
    FROM     FilteredAct_application AS CRMAF_FilteredAct_application
    WHERE  (act_dateclosed BETWEEN @startdate AND @enddate) AND (statuscodename IN (@currentStatus)) AND (act_actorname = @actor)

    Thank you in advance,


    Wednesday, July 20, 2016 7:12 PM

All replies

  • Prefiltering depends on the records selected when you run the report - what selection options did you use ?

    If you've CRM OnPremise, you could try using SQL Profiler to capture the query that CRM submits (prefiltering modifies the SQL and adds some parameters)

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Thursday, July 21, 2016 5:53 AM
  • Hi Chrys,

    Please check default filter applied on this report and it is possible because of this, relevant record is excluded so on reports screen click on Edit Default filter option and here clear any filter condition and then save this filter and then run this report to see if this works..

    My Blog
    Follow Me on Twitter

    Thursday, July 21, 2016 11:46 AM