Activity Forums Salesforce® Discussions 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.

  • Aman

    Member
    April 27, 2018 at 9:30 am

    Hi Pranav,

    with javascript you can do that :

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

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos