Activity Forums Salesforce® Discussions How to detect in which Salesforce environment I am working? Reply To: How to detect in which Salesforce environment I am working?

  • Manpreet

    Member
    April 26, 2018 at 4:53 pm

    Hi Pranav,

    With Spring 16 release, we are getting new values added to the existing $User.UITheme Global variable and to the UserInfo.getUiTheme() method which will help us to identify the current user's UI mode.

    here's the list of possible values

    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
    hopefully we can use this in Workflows, Validations, Formulas, Apex & Visualforce..

    Thanks.