How to determine if user is in lightning or classic

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Salesforce has properties called UITheme and UIThemeDisplayed in the $User global variable for use in visual force pages. When I access skuid's version of the $User global variable, I don't see these properties. How can I know if a user is in lightning or classic from a skuid page?
Photo of Keith Heard

Keith Heard

  • 122 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,242 Points 20k badge 2x thumb
In version 10 of Skuid, from JavaScript you can do the following check to determine whether you're in Lightning Experience:

var inLEX = skuid.platform.get("SFUITheme")==="Theme4d";console.log("Are we in Lightning Experience? " + (inLEX ? "Yes" : "No"));