Activity › Forums › Salesforce® Discussions › How to detect in which Salesforce environment I am working?
Tagged: Customer Portal, Salesforce AppExchange, Salesforce Classic, Salesforce Edition, Salesforce Spring 16, Salesforce1
-
How to detect in which Salesforce environment I am working?
Posted by PRANAV on April 26, 2018 at 4:43 PMHow to detect in which Salesforce environment I am working?
Aman replied 8 years ago 3 Members · 2 Replies -
2 Replies
-
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.
- [adinserter block='9']
-
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.