+ Start a Discussion
Justin RuckJustin Ruck 

Not able to switch to Lightning from VF page

My landing page in Classic is a VisualForce page.  I have Lightning Experience enabled.  When I'm on the landing page in Classic and I click my name then "Switch to Lightning Experience", the page goes nowhere.  However, when I go to a standard tab, like Opportunities, then click "Switch to Lightning Experience", it works just fine.  This is affecting all users in my org.

Any idea what might be going wrong?

I'll paste my VF page code below, but there's no reason why it should affect this.
 
<apex:page controller="ChartClass" title="Metrie Home Page" readonly="true">
    
    <apex:sectionHeader title="Metrie Home Page" subtitle="">
        <apex:panelGrid columns="1" width="100%">
            <c:NewsTicker />
        </apex:panelGrid>
        <apex:outputText value="Viewing {0}" style="font-size:22px;font-weight:bold;">
            <apex:param value="{!chartScope}"/>
        </apex:outputText>
    </apex:sectionHeader>
    
    <apex:panelGrid columns="2">
        
        <apex:panelGrid columns="1">
            
            <apex:panelGrid columns="3" width="100%">
                <c:MetrieNewsComponent />
                <c:MetrieHomePageComponent />
                <c:GamificationComponent />
            </apex:panelGrid>
            
            <apex:panelGrid columns="3" width="100%">
                <apex:panelgroup >
                    <c:Top10OpenOppsList />
                </apex:panelgroup>
                <apex:panelgroup >
                    <c:Top10CasesList />
                    <c:OpenCasesComponent />
                </apex:panelgroup>
                
                <apex:panelgroup >
                    <c:OpenTaskComponent />
                    <a href="/007">Click here for more open Tasks</a>
                </apex:panelgroup>
            </apex:panelGrid>
        </apex:panelGrid>

        

        <apex:panelGrid columns="1" width="100%" >            
            <apex:outputPanel layout="block" style="overflow:auto;width:500px;height:667px" >
                <chatter:newsfeed />
            </apex:outputPanel>
        </apex:panelGrid>
    </apex:panelGrid>
    
</apex:page>



 
Best Answer chosen by Justin Ruck
pconpcon
I am also able to reproduce this behavior.  It is not tied to your Visualforce since it did the same thing on a random Visualforce page for me.  I would recommend that you file a bug with Salesforce support for this.

All Answers

pconpcon
I am also able to reproduce this behavior.  It is not tied to your Visualforce since it did the same thing on a random Visualforce page for me.  I would recommend that you file a bug with Salesforce support for this.
This was selected as the best answer
bryan.andersonbryan.anderson
This happens in every org I have tried in, even a brand new Visualforce page that is essentially blank. The issue is that the Visualforce pages are on a different domain (force.com) than what the "toggle" function is attempting to access (salesforce.com).

Here is the example error from Chrome's DevTools console:

"XMLHttpRequest cannot load https://gs0.salesforce.com/_ui/system/context/UserContextServlet. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://c.gus.visual.force.com' is therefore not allowed access."

I tested in a Spring '16 pre-release org and the error is encountered there as well. It is definitely an issue Salesforce needs to resolve.
Justin RuckJustin Ruck
I contacted Salesforce support, and they are aware of the issue.  They are tracking at https://success.salesforce.com/issues_view?id=a1p30000000jbnhAAA.  Please make sure to click the "This Issue Affects Me" button.
bryan.andersonbryan.anderson
Thanks for the info, I have selected that the issue affects me.
Brandon H. BarrBrandon H. Barr
Also able to reproduce both with a created VF page and a VF page in one of my managed packages.
Rich Beliveau 19Rich Beliveau 19
I am able to reproduce this as well in the current Spring 17' Release.