Thursday, 21 January 2021

How to provide navigation in VF Page for lightning and classic

 Hi ,

We are going to discuss that how we can provide navigation when we have to navigate to another VF page from a VF page in lightning and classic.


if('{!$User.UITheme}'=='Theme4d' || '{!$User.UITheme}'=='Theme4u' ||                         '{!$User.UITheme}'=='Theme4t') {              

             //Lightning

              sforce.one.navigateToURL(urlLink);

} else {

           //Classic 

window.location.href = urlLink;

}


References:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_useruitheme.htm

No comments:

Post a Comment

How to Execute Einstein Prompt Templates Using Apex (Calling Salesforce Prompt Templates Programmatically with Apex)

 Hi, Here, we’ll explore how to execute a Prompt Template using Apex. To understand this better, let’s take a sample Flex Prompt Template ca...