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
Ashsih jaiswalAshsih jaiswal 

how to naviagte to vf page on button click at lighting

HI All,

I have one custom VF page. I want to open th vf page on button click at lighting community. How can I achieve the functionality.
I am new in lightning 
Shubham_KumarShubham_Kumar
Hi

You can navigate to the vf page using the navigateToUrl event in lightning
Use the button in lightning component to call a JS Controller function  like this 

 <lightning:button variant="brand" label="Navigate" onclick="{! c.navigateToPage}" />  
 
navigateToPage: function(component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
        "url":"vfpage url" //Enter your page url here
    });
    urlEvent.fire(); }
Do let me know if you have any further queries.

P.S: Kindly mark this as the best answer if this helped you.

Thanks and Regards
Shubham Kumar
 
Shubham_KumarShubham_Kumar
Hi 
Could you please tell me the name of your page and the name of the parameter that you are trying to pass in the url.