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

One thought 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,

Leave a Reply

Your email address will not be published. Required fields are marked *