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
Pavan Kumar PPavan Kumar P 

custom link is working only for classic users but not for lightning user

Hi,

I have a scenario where custom link should redirect to report with filter value passed in both lightning and classic depending which user it is.

See the custom link which I have tried which is redirecting correctly to Report for classic users but not for lightning users:

/{!IF($User.UIThemeDisplayed="Theme4d","lightning/r/Report/","")}<ReportID>?{!IF($User.UIThemeDisplayed="Theme4d","fv2","pv2")}={!<sObject>.<fieldname>}

Could you please help me in modifying the above custom link in such a way that it works in both classic and lightning users

Thanks in Advance.

Regards,
Pavan Kumar P.
VinayVinay (Salesforce Developers) 
Hi Pavan,

Review below links which can help you.

https://success.salesforce.com/answers?id=9063A000000pt7jQAA
https://help.salesforce.com/articleView?id=reports_filter_url.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Pavan Kumar PPavan Kumar P
Thanks vinay for the response.

But it is still not helping me.

Regards,
Pavan
VinayVinay (Salesforce Developers) 
Hi Pavan,

Can you try below.

/lightning/r/Report/reportid/view?fv0={!sObject.Id}

if this doesn't work can you post your logic written?

Thanks,
Vinay Kumar