We have created a softphone using visualforce components. In classic it is fine, but when a user opens lightning experience some places are looking like classic only like lookup pages etc. How we can change that UI as lightning page when user in lightning experience.


You can use Global element User.UIThemeDisplayed to identify if you are classic or in LEX and based on that can show different UI.

<apex:outputPanel rendered="{! $User.UIThemeDisplayed == 'Theme3' }">
    <apex:outputText value="This is Salesforce Classic."/>
    <apex:outputText value="These are multiple components wrapped by an outputPanel."/>
<apex:outputPanel rendered="{! $User.UIThemeDisplayed == 'Theme4d' }">
    <apex:outputText value="Everything is simpler in Lightning Experience."/>

Share Visualforce Between Classic and Lightning Experience

  • Thanks but We are using remoteAction methods along with javascript and jquery for softphone and dialer. We didn't used these visualforce components much. can you help me in this @Tushar Sharma. – ApexCode Feb 22 '18 at 13:22
  • @ApexCode sure Add these lines in your VF page and you will get different message based on selected UI. And then remove the content of outputpanel and then you need to use different lookup one for classic and one for lightning. – Tushar Sharma Feb 22 '18 at 13:55
  • Hi Tushar can we do like this, if user clicks on contact lookup it has to check the current page url and based on page url it navigates to associate visualforce pages. – ApexCode Feb 26 '18 at 13:08
  • @ApexCode you need to create custom lookup for this. – Tushar Sharma Feb 26 '18 at 13:50

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.