Friday, October 04, 2019

Checking Salesforce Classic or Salesforce LEX using javascript

Simple as this :

1
2
3
4
5
6
7
8
9
var isClassic ='false';

 console.log ('@@@ UIThemeDisplayed '+ '
{!$User.UIThemeDisplayed}');
 if('{!$User.UIThemeDisplayed}
' == 'Theme3')
{
   isClassic='true'; 
}

To use visualforce page within Salesforce LEX is to use this url . Some scenario that you might want to apply this is when you want to redirect to Visualforce page in Lightning.

1
/one/one.app#/alohaRedirect/apex/apexpagename?parameter