The use of custom links to generate reports in classic Salesforce was possible using the url hacks and it was easy to append the report id at the end of the url and add the dynamic parameters as pv0, pv1 and so on..
But, with the introduction of lightning the url hack is not easy, rather it's very difficult to predict the url within lightning. With Spring'17 release, they have introduced dynamic custom reports
https://releasenotes.docs.salesforce.com/en-us/spring17/release-notes/rn_rd_reports_filter_url.htm
I am looking for ways to use the same custom link to redirect to classic reports as well as lightning reports. Here are the options I tried,
- IF with the CONTAINS method to see if the API base url contains "lightning.salesforce.com" (which may not be always true, looking at the release notes example) and then construct a hyperlink based off the IF result. Since the lightning url has multiple parameters, its difficult to hack the url.
- I read about Global actions, which would be the the perfect way to overcome the url hacks, but looks like that's more useful when we are trying to create/update records. It doesn't seem to fit my requirements.