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
Neha Mishra 51Neha Mishra 51 

What is the best way to open a visualforce page on button click in lightning?

We are upgrading our salesforce development to make it compatible with lightning. 

In a few cases, we just need to open a visual force page on click of a button. We implemented this via script "window.open = {url}" using "on click of javascript" option. 

Is it mandatory to use aura components to open up the page? Or directly opening up a new visual force page on click of a button will be good?

I understand both will work, but what is the best way to handle this?

yogesh_patilyogesh_patil
Is it mandatory to use aura components to open up the page? --> NO

Or directly opening up a new visual force page on click of a button will be good? --> Ok, depends.