6

Though not well documented by Salesforce, it's a well known fact that record pages and saved reports can be dynamically altered by passing URL parameters. For example, with a tabular report whose first filter is "Account Name", you can pass the filter value via a modified URL, like so:

/(reportSFID)?pv0=(Account Name)

to load the report on that specific account.

My question is in regard to filters on Date values. When I pass a specific date to a date filter value, eg '1/1/2014', it works fine. BUT, when I attempt to pass a date literal, eg 'LAST FISCAL QUARTER', it just takes me to the edit page of the report (which seems to indicate a failure with passing the value).

Has anyone had any experience passing date literal values using dynamic URLs?


EDIT: A little more messing around and I discovered a couple things:

  • Certain Date Literals CAN be passed - if they are multiple words you need to use underscores in the URL. For example,

/(reportSFID)?pv0=LAST_MONTH

  • Date literals that specify numerical ranges still don't seem to work, eg "LAST_6_MONTHS". Any insight on whether its possible to use these types of date literals is appreciated!
  • 2
    Maybe it's looking for SOQL date literals, such as LAST_N_MONTHS:6. – sfdcfox Jun 2 '14 at 18:42
  • That's it! If you'd like, post it as an answer and I'll choose it. – smohyee Jun 2 '14 at 19:20
  • Simply an educated guess. I wasn't sure, and didn't have a way to test when I posted it. – sfdcfox Jun 2 '14 at 19:29
5

You can use SOQL date literals, such as LAST_N_MONTHS:6 or LAST_N_DAYS:90.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.