0

How can I change Salesforce User Interface theme? Specifically I want to change the value returned by the UserInfo.getUiTheme() method. There doesn't seem to be a corresponding field on the User object.

  • What do you want to achieve? Seems like you want to switch between classic and lightning UI, it can be managed by profiles. – Raul Feb 7 '17 at 7:48
  • I got to know that there is UserInfo class and then there is a method called 'getUiTheme()'. here is the link developer.salesforce.com/docs/atlas.en-us.apexcode.meta/… So i want to try different themes listed in my dev org :) – Sourabh Coolkarni Feb 7 '17 at 8:30
  • I think, you need to create html component on your home page to set it up. – sfdcFanBoy Feb 7 '17 at 11:37
2

First, getUITheme only returns the user's preferred theme. What you are looking for is getUIThemeDisplayed, which returns the active theme. See here: UserInfo Class

Now, if you look at that link, there are many different themes, including obsolete interfaces. There is no way to programmatically switch between these themes. If you want to switch from classic to SF1 theme, log in on a mobile device. If you want to switch from classic to lightning, you can switch by clicking on your name in the top right -> switch to lightning experience. This is, of course, assuming lightning is enabled in your org. For more information on enabling lightning, see this: Enable Lightning Experience

  • There is no way to programmatically switch between these themes. :( – Sourabh Coolkarni Feb 7 '17 at 12:23

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.