Now with Spring 16 release, Developers and Admins can easily identify the current user's Salesforce user interface mode or theme - i.e if the running user is using Salesforce Classic UI or the new Lightning Experience in desktop or if the user is in Salesforce1 mobile.
We now have new set of values included in the existing User Context Global variables (both $User in workflows/validations/visualforce/formulas and also to the UserInfo class in Apex)
with this, we can simply call either UserInfo.getUiTheme( ) method or $User.UiTheme variable to identify the running user's UI mode.
here's the list of UI Themes returned by this global variable
Reference :
You will find this cool feature documented (buried) deep inside the Spring 16 release notes
We now have new set of values included in the existing User Context Global variables (both $User in workflows/validations/visualforce/formulas and also to the UserInfo class in Apex)
with this, we can simply call either UserInfo.getUiTheme( ) method or $User.UiTheme variable to identify the running user's UI mode.
here's the list of UI Themes returned by this global variable
- Theme1—Obsolete Salesforce theme
- Theme2—Salesforce Classic 2005 user interface theme
- Theme3—Salesforce Classic 2010 user interface theme
- Theme4d—Modern “Lightning Experience” Salesforce theme
- Theme4t—Salesforce1 mobile Salesforce theme
- PortalDefault—Salesforce Customer Portal theme
- Webstore—Salesforce AppExchange theme
Reference :
You will find this cool feature documented (buried) deep inside the Spring 16 release notes
No comments:
Post a Comment