Answered by:
CRM Reports and Passing a Parameter

Question
-
Hi there, I'm trying to create a SRS Report for CRM 4.0 and I need CRM to pass the current Contact's GUID to the report when it is called so I can then append it to the WHERE clause and get a sensible data result.
I have defined a Parameter in the report called CRM_ContactID however CRM does not pass anything to that Parameter when you call the report from the Contact form. Am I doing something blindingly stupid? I figured that CRM shoudl be able to do this.Tuesday, June 30, 2009 4:25 PM
Answers
-
Check out this post and see if it helps. If you want to run the report on a single record from CRM, you should not have to use a where clause for the guid.
Best Regards, Donna- Proposed as answer by Donna EdwardsMVP Tuesday, June 30, 2009 5:19 PM
- Marked as answer by Jim StegerMVP, Moderator Wednesday, July 1, 2009 3:42 PM
Tuesday, June 30, 2009 5:18 PM
All replies
-
Check out this post and see if it helps. If you want to run the report on a single record from CRM, you should not have to use a where clause for the guid.
Best Regards, Donna- Proposed as answer by Donna EdwardsMVP Tuesday, June 30, 2009 5:19 PM
- Marked as answer by Jim StegerMVP, Moderator Wednesday, July 1, 2009 3:42 PM
Tuesday, June 30, 2009 5:18 PM -
Thanks for that Donna, it was certainly helpful.
However it has not solved the problem. The report shows in the contact reports menu under 'Run on Current Record' however when you run it the report returns thousands of pages, pretty much one for every contact report.
Here's the SQL:
SELECT CRMAF_FilteredContact.accountidname, CRMAF_FilteredContact.address1_line1, CRMAF_FilteredContact.address1_line2,
CRMAF_FilteredContact.address1_line3, CRMAF_FilteredContact.address1_city, CRMAF_FilteredContact.address1_stateorprovince,
CRMAF_FilteredContact.address1_postalcode, CRMAF_FilteredContact.firstname, CRMAF_FilteredContact.lastname, CRMAF_FilteredContact.emailaddress1,
CRMAF_FilteredContact.telephone1, CRMAF_FilteredContact.fax, CRMAF_FilteredContact.contactid, CRMAF_FilteredAccount.new_fsanumber,
CRMAF_FilteredAccount.def_registerednumber
FROM FilteredContact AS CRMAF_FilteredContact LEFT OUTER JOIN
FilteredAccount AS CRMAF_FilteredAccount ON CRMAF_FilteredContact.accountid = CRMAF_FilteredAccount.accountidWednesday, July 1, 2009 8:17 AM -
Right, I've solved the problem.
The issue was that the report had been hacked by our customer from an old CRM 3.0 report and had a default CRM_FilteredContact value set that was overwriting the one passed from CRM4. By removing the parameter from the report I have now got it working correctly with the single records.Wednesday, July 1, 2009 10:25 AM