You need to sign in to do that
Don't have an account?
RDN_LHR
Running report from URL and adding date criteria
Hi,
I'm trying to call reports via URLs, and I would like to pass a date value through the URL as filter criteria. I've done this lots with text values but not dates.
My URL looks like this:
When I click this, I get the report's criteria page , with the date placed where it belongs in the filter area, but with an "Error: Invalid date" message which says that the date needs to be formatted like "29/09/2008" -- which it clearly is. Without making any changes at all to the date in the box, I click Run Report and the report runs fine.
Naturally, I'd like my end users to just get the report results, not have to see the criteria page, plus the resulting error, and then have to click Run Report.
Can anyone help?
https://emea.salesforce.com/00O20000001zI6o?pv0=29/09/2008
You also need a pn0 and pv0
To figure out what pnX should be, open a report in salesforce and go to the "step 6: select your report criteria section." do a view source and search for pc0, pn0, pv0.
try date as 09/29/2008
I get the feeling that if I changed my settings from English UK to English US and then passed the date in US format, I'm still going to get the same error.
You can't input US format dates into a report criteria page without being in English US.
I really hope I can solve this. Salesforce.com themselves are of no help.
go to the report in salesforce and enter the criteria - what criteria value (date format) will let you run the report?
How about trying: 29%2F09%2F2008
Hello, I just wonder if you could resolve your issue with passing a date value through a url ...
I would be extremly intrested in the solution as I am trying to resolve this issue too.
I have noticed that the problem doesn't occur if the Local Settings on the user detail is set to "English (United States)" but this is not really exceptable for users i.e. in Europe.
Looking forward to hearing from you or someone else.
Hello,
I have now resolved this for my org.
Here is my solution which is of interest for orgs which use the European time format DD/MM/YYYY:
1. In the report URL, do NOT include the "Date Field" which is sending the value 29/09/2008 https://emea.salesforce.com/00O20000001zI6o?pv0=
DateField. - Why? When running the report through the url, salesforce.com is always interpeting the value 29/09/2008 as MM/DD/YYYY instead of DD/MM/YYYY. The error message occurs because there is obviously no month 29.2. INSTEAD create new a formula text field called i.e. "Date Report Field" where your initial Date Field is embedded. The formula is: text(MONTH(Date Field)) & "/" & text(DAY( Date Field)) & "/" & text(YEAR( Date Field)) . Note that the order of the elements in the formula must be month, day, year! - There is no need to include this field into any page layouts.
3. Now, create your report URL based on the new FORMULA TEXT FIELD as follows: https://emea.salesforce.com/00O20000001zI6o?pv0=Date Report Field. Done! Your report will run smoothly.
This is working well for my org, even if I change the user local settings from English UK to English USA.
Good luck to you!
Thank you very much, this solved my problem. Thanks for posting this answer! :)