function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deyan Chugunov 7Deyan Chugunov 7 

Lightning Experience gets 'removed' when redirecting from Visualforce page

Hi all,

I`m struggling to fix an issue which arise with the new Salesforce Lightning Experience. So, I have a Visualforce page which is assigned to the Edit functionality of Accounts. In Salesforce Classic mode everything works perfectly good, but when I switch to the new Lightning Experience I get a strange behavior on redirect - the lightning is removed and I get redirected to the classic mode page. I hope to clarify things with the below screenshots.

First, I edit one of my accounts to go to my Visualforce page.
User-added image

First, I edit one of my accounts to go to my Visualforce page.
User-added image

First, I edit one of my accounts to go to my Visualforce page.User-added image

I'm using PageReference object in my Apex controller for navigation, but from what I've red it is not working with the Lightning.
For example:
 
    PageReference pg = null;
    try{
        pg = stdController.save();  
    }catch(Exception ex){           
        Logger.Instance.LogException(ex, false);
    }

    return pg;
If anyone can give me directions, I would be very grateful!
 
Amit GoyalAmit Goyal
Hi Deyan Chugunov 7,

I know the pageReference should work as per my knowledge as navigation works in both classic and experience.

try "Modern Visualforce Navigation" section in the below trailhead too:
https://developer.salesforce.com/trailhead/lex_dev_visualforce/lex_dev_visualforce_navigation

Thanks,
Amit Goyal
Deyan Chugunov 11Deyan Chugunov 11
Hi Amit,
Thank you for your aswer!
However I will keep looking. If you run across any workaround I would be very grateful if you share it
Thanks!
Deyan Chugunov 11Deyan Chugunov 11
Hi Amit,
It seems like I am affected from this issue - https://success.salesforce.com/issues_view?id=a1p30000000eNbiAAE
Piyush DivechaPiyush Divecha
Hi,
Do we have any workaround/solution for 'Lightning experience' getting removed. I have a popup page with one button. On this button click I am redirecting to Visualforce page using 'window.top.location.href'. I am able to redirect to VF page but Lightning menu is gone. It works fine in Salesforce Classic. Please let me know if there is any solution available.

Thank You,
Piyush Divecha