Business wants to build reports dynamically based on date of campaign and then include them part of a home page.

There are two things to be done here

  1. Create reports automatically based on a campaign start date
  2. We use lightning in our company and they want this report to be added as a component to home page.

I was looking for ability to build reports dynamically using SOQL but from what I have researched online, this functionality is not yet available . Need some suggestions on whether this can be achieved or not


Looking at the report object in the API developer guide access is read only through the api. So I'm not sure you can can even generate a report like you would generate a new Account record.

What if you just created your report and passed filters through the link to the report. That way you're dates can be dynamic and you only need to build one report. It's called url hacking and you would set the value in the url for the filter in the link.

Example of what I'm talking about here: What is the URL parameter for populating Cross object filters on reports? URL hacking a report to pass a Date Literal filter value vs an actual date http://www.tgerm.com/2011/04/passing-params-to-reports-salesforce.html

| improve this answer | |
  • URL hacking is definitely doable in Classic (see Dan's links) but with Lightning it's limited. Spring '17 introduced URL hacking, but as of yet I haven't see a way to soft code that URL hacking. In Classic you could do something like this is custom link: /[id of report]?pv0=[value for first filter] In Lightning, the link to the report works, but the pv0 is dropped. (Note: Lightning is also different, using "fv0") More StackExchange discussion here – Stephen Feb 24 '17 at 16:27

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.