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
Leticia Monteiro Freitas 4Leticia Monteiro Freitas 4 

Passing parameter to VFPage from Lightning component

Hi, I'm trying to call a Vf page from a lightning button inside a lightning component, and it works fine,except to set my param:

 
<!-- ccomponnet controller>

 openPdf : function(component, event, helper){
       var url = '/apex/nameOFPage?week=23';
         
       var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url":url
        });
        urlEvent.fire(); 
    },


<!---- vfpagecontroller  -->

public class weekCTRL{
    
  public integer week  {get;set;}

    
    public Forecast_CTR_renderTable(){
      
    }
}
ShirishaShirisha (Salesforce Developers) 

Hi Leticia,

Greetings!

Can you please check the below blog which will guide you in passing the parameters from Lightning component to VF page.

https://www.sfdcstuff.com/2017/07/firing-event-from-lightning-component.html

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri