I have console application that was developed in salesforce classic UI. Now I want to support this application for salesforce lightning UI in Lightning console app.

there are some scripts that i want to add in my app based on theme selected. for that I am using, below script, i had written for Lightning Experience.

<apex:outputPanel rendered="{!$User.UITheme == 'Theme4d'}">
    <script type="text/javascript" src="/support/api/38.0/lightning/opencti_min.js"></script>
    <script src="/soap/ajax/38.0/connection.js"></script>

and for salesforce classic i had return following script.

<apex:outputPanel rendered="{!$User.UITheme == 'Theme3'}">
       <script src="/support/api/38.0/interaction.js"></script>
       <script src="/support/console/38.0/integration.js"></script>
       <script src="/soap/ajax/38.0/connection.js"></script>

Issue is that $User.UITheme always retunrs Theme3 for both salesforce classic and salesforce Lightning Experience.

I am i missing any settings or what is wrong in this case ?

Any help or Workaround to this ?

I also tried with UserInfo.getUiTheme( ), it is also giving me Theme3 for both the experience.

currently I am using ap5 domain


1 Answer 1


This may be linked to this known issue.


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.