3

I am trying to use CRM CRMAF Filter in a report for CRM 2011. But I can't find any examples on how to do it. What does the query need to be changed to to filter on Quotes and what Parameter needs to be added.

SELECT           Quote.QuoteNumber, Quote.Name, Quote.CreatedOn, Quote.CustomerIdName, Quote.OwnerIdName, SystemUser.Address1_Telephone1, 
                         SystemUser.InternalEMailAddress, Quote.Name AS Expr1, Quote.BillTo_Line1, Quote.BillTo_Line2, Quote.BillTo_Line3, Quote.BillTo_StateOrProvince, 
                         Quote.BillTo_PostalCode, Quote.BillTo_Telephone, Quote.BillTo_Fax, QuoteDetail.LineItemNumber, QuoteDetail.Quantity, QuoteDetail.ProductId, 
                         QuoteDetail.ProductDescription, QuoteDetail.BaseAmount, QuoteDetail.ExtendedAmount, Quote.DiscountAmount, Quote.TotalTax, Quote.TotalAmount, 
                         Quote.RevisionNumber
FROM            Quote INNER JOIN
                         QuoteDetail ON Quote.QuoteId = QuoteDetail.QuoteId INNER JOIN
                         SystemUser ON Quote.OwnerId = SystemUser.SystemUserId
Liam
  • 27,717
  • 28
  • 128
  • 190

1 Answers1

4

Here is one reference you can take a look at: http://blogs.msdn.com/b/crm/archive/2009/03/06/microsoft-dynamics-crm-pre-filtering-tips.aspx

You end up using the special filtered views that CRM creates for each entity.

SELECT name, accountnumber 
FROM FilteredAccount as CRMAF_Account

Another reference: http://msdn.microsoft.com/en-us/library/gg309722

Jason Lattimer
  • 2,858
  • 15
  • 14