Use Visualforce in Classic and Lightning Experience

How to design a Visualforce page so that It would be displayed properly in classic as well in Salesforce Lightning Experience

Same Visualforce in classic and Lightning

This topic was subset of my presentation in Salesforce Boston World Tour 2017. Sometimes we find our-self in situation where custom Visualforce page should be displayed with Old theme in classic but with Lightning theme in Lightning Experience.

If you can convince client to use same user interface in classic and Lightning, then it would be an ideal approach. Even Salesforce displays classic user interface for many setup pages inside Lightning experience.

If client does not agree, then we simply need to detect that in which context Visualforce is running and then enable or disable the section as per UIThemeDisplayed global variable as shown in below Apex code snippet.

Related posts

2 thoughts on “Use Visualforce in Classic and Lightning Experience”

  1. Hi Jitendra, I’d rather had the same question posted on your previous blog too. Which is from where you bind the filterId, listViewOptions variables are bind to in standard controllers? and there’s init(); method too. But i couldn’t find the implementation. Please help me to understand the concept here

    Many thanks,
    Manny

  2. Can you please help me on the lookup field UI change? once the VF page has been changed to match Lightning UI, if you click on any of the lookup fields on that VF page then it still opens in classic UI.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.