function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Karthika A 7Karthika A 7 

Looking to create a custom url for Detail page link

I am creating a detail page link in a page layout.
I have created a report and wanted this detail page link to point to my report based on the Campaign Name.
How do I create a custom url for this?

Any suggestions please?
Best Answer chosen by Karthika A 7
CloudyCloudy
Hi,

Assuming you're on a campaign detail record, you can call your report with a Detail page link to the following URL:
/lightning/r/Report/<your report id>/view?fv0={!Campaign.Name}
fv0 being your first custom filter on your report

regards

All Answers

Ashish Singh SFDCAshish Singh SFDC
Hi Karthika,

There could be multiple approaches to solve your requirement.

With Formula field: Create Hyperlink Formula (https://help.salesforce.com/articleView?id=sf.tips_for_using_hyperlink_formula_fields.htm&type=5) which can point to your report conditionally.

Create a Visualforce command link that can allow redirecting to your report conditionally. See Example (https://developer.salesforce.com/forums/?id=906F0000000987PIAQ).

Thanks,
Ashish Singh
CloudyCloudy
Hi,

Assuming you're on a campaign detail record, you can call your report with a Detail page link to the following URL:
/lightning/r/Report/<your report id>/view?fv0={!Campaign.Name}
fv0 being your first custom filter on your report

regards
This was selected as the best answer
Karthika A 7Karthika A 7
Hi Cloudy,
Thanks for the reply. It works well.
I want to set the report Id dynamically, because for each environment the report Id will vary right? how do I get/set the report Id dynamically?

Any suggestions please?