Loading
Prepare for Email to Become the Default Login ExperienceRead More
Set Up and Maintain Your Salesforce Organization
Update Visualforce Markup for Lightning Experience

Update Visualforce Markup for Lightning Experience

Some Visualforce pages may need tweaking to work in Lightning Experience. Don’t worry if you don’t have Visualforce experience—the workarounds show you exactly what to do each step of the way. Always test your Visualforce page in Lightning Experience first—most work as-is. If the listed issue is preventing the page from working properly, follow the instructions to tweak the markup and make it work. If a Visualforce page requires significant refactoring, move it to a Lightning component.

Required Editions

Available in: Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions
  • Reconfigure iframe Components
    When a URL is displayed in an inline frame (iframe) on a Visualforce page, it can cause errors in Lightning Experience. Sometimes your URL looks different than you want, or maybe the whole page doesn't load in Lightning Experience. Most iframes are compatible with Visualforce in Lightning Experience. However, if you preview your Visualforce page in Lightning Experience and don't like what you see, you can usually fix it.
  • Replace the window.location Method
    The window.location variable is a JavaScript method used to redirect the browser to a new page. JavaScript code in a Visualforce page that sets window.location directly isn't compatible with Lightning Experience. That's the bad news. The good news is that sforce.one navigation methods do the same thing, and are compatible with Lightning Experience.
  • Replace Static URLs
    Lightning Experience doesn't support the use of static URLs to link to Salesforce resources. Fortunately, there's a much better alternative that future proofs your URLs. URLFOR is a function that calculates a URL based on inputs, rather than relying on something static that can't change. Use the URLFOR function with the appropriate action instead of direct URLs.
  • Apply Lightning Stylesheets to Visualforce Pages Manually
    With Lightning stylesheets, it’s easy to tweak your existing Visualforce pages so they’ll display with classic styling in Salesforce Classic and Lightning styling in Lightning Experience.
 
Loading
Salesforce Help | Article