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
Neethu uNeethu u 

$User.UIThemeDisplayed not working in Custom Link

I have a custom link which checks whether the theme is lightning, if yes redirecting to lightning report, if no redirect to classic report.
IF({!$User.UIThemeDisplayed}="Theme4d",
This is the condition check I am doing. And I am getting Theme3 as the theme for both classic and lightning .
I am not able to distinguish between lightning and classic with this global variable.
Any help is much appreciated
Khan AnasKhan Anas (Salesforce Developers) 
Hi Neethu,

Greetings to you!

Unfortunately, using $User.UIThemeDisplayed to Custom Links doesn't work. Fields and text that are merged into a Custom Link from a formula expression are URL-escaped, which destroys the link.

Also, this may be linked to this known issue: https://success.salesforce.com/issues_view?id=a1p3A000000EAWGQA4&title=user-uithemedisplayed-always-results-in-theme3-in-cti-even-in-lightning

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas