2

I am in the process of moving to Lightning, and have some issues with Visual Force pages and when they display.

My VF pages are all set with the "Available for Salesforce mobile apps and Lightning Pages" un-checked. This is intentional, as the pages are complex, and not well-suited for Salesforce1. Due to their complexity, I also prefer to put them on a separate tab in the Tab Control on a Lightning page. But despite the setting being un-checked, the VF pages still appear on the detail tab of the in the Tab Control.

I know I can take it out of the details tab by changing the page layout, but then Salesforce Classic users don't see the VF pages at all.

Is there a way to make the VF pages / page layouts "respect" the "Available for Salesforce mobile apps and Lightning Pages" setting?

I have to obscure much of the page due to confidentiality reasons, but I've attached a screen shot of the Lightning Page, employing the Lightning Tab Component. The "Detail" tab pulls in the complete page layout.

I have to obscure much of the page due to confidentiality reasons, but I've attached a screen shot of the Lightning Page, employing the Lightning Tab Component.  The "Detail" tab pulls in the complete page layout

Any help would be appreciated!

2
  • Is this at the detail ?Can you screenshot an example .Thanks Commented Oct 12, 2016 at 21:36
  • I've edited to include a screen shot. Lots of it is obscured, but still should be enough to understand the layout. Thanks!
    – Mike Conte
    Commented Oct 12, 2016 at 22:29

1 Answer 1

2

Sounds like a candidate for the ideaExchange .Currently the workaround can be wrapping the whole page inside an outputPanel and rendering only for classic theme .

Here is an example from sfdc on how to achieve this

<apex:page>
 <apex:stylesheet value="{!URLFOR($Resource.slds, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
<apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme3'}">
    <apex:pageBlock title="Visualforce (Using standard Visualforce Components)" mode="detail">
        <apex:outputLabel value="UI Theme Detection using Global Variables: {!$User.UIThemeDisplayed}"/>
    </apex:pageBlock>
</apex:outputPanel>
<apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme4d'}">
   <div class="slds">
<div class="slds-card slds-card--empty">
 <div class="slds-card__header slds-grid grid--flex-spread">
   <h2 class="slds-text-heading--small slds-truncate">Visualforce (Using HTML + SLDS)</h2>
 </div>
  <div class="slds-card__body slds-p-horizontal--small">
    <h3 class="slds-text-heading--small slds-p-top--large slds-p-bottom--large">UI Theme Detection using Global Variables: {!$User.UIThemeDisplayed}</h3>
  </div>
 </div>
</div>
   </apex:outputPanel>
 </apex:page>

In nutshell you will simply use the outputpanel and detect via theme 3 .

3
  • mohit please link the doc to see what differnet themes mean. This is an awesome answer, never knew you can control by theme. Isthis is a winter 17 feature?
    – Rao
    Commented Oct 12, 2016 at 22:54
  • 1
    I have linked the blogpost .The feature was available in spring 16 Commented Oct 12, 2016 at 23:08
  • Thanks, Mohith! This does show/hide the panel based on Lightning vs. Classic. However, the Page Layout section still exists as a Section Heading and a big blank space on the Lightning Page. Is there any way to suppress the Section Heading from the Page Layout? If users were Lightning-only or Classic-only I could control by duplicating my page layouts (painful), but not sure if I can limit them from switching between Lightning and Classic.
    – Mike Conte
    Commented Oct 13, 2016 at 10:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .