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


    April 26, 2018 at 4:43 pm

    How to detect in which Salesforce environment I am working?

  • Manpreet

    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..


  • Aman

    April 27, 2018 at 9:30 am

    Hi Pranav,

    with javascript you can do that :

    if(document.referrer.indexOf("") > 0){
    alert("welcome to lightning ");
    alert("welcome to classic");

Viewing 1 - 3 of 3 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos