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
Shweta Choudhary 17Shweta Choudhary 17 

how to call a visualforce component from a lightning component with a button click

I want to display the sample of the data present in visualforce component when the button is clicked.the button is created on a lightning component.any suggestions.
 
Rajeevan SRajeevan S
hi Shweta,

I don't think you can use Visualforce inside lightning component, you can use the other way around.
You can call the Lighting from Visualforce using <apex:includeLightning/> and $Lightning.use.

Check out the documentation below for reference,
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm#:~:text=Add%20the%20Lightning%20Components%20for,createComponent()%20.

Mark this answer if  it helps.
ravi soniravi soni
hi shweta,
you can not use visualforce component in lightning component.
here is the ref link for justification : https://developer.salesforce.com/forums/?id=9060G000000XbYQQA0

don't forget to mark it as best answer.

Thank you
Suraj Tripathi 47Suraj Tripathi 47

Hi Shweta,
we can call vf page in lightening component by passing the url of vf page in js of component. For more details use below link

https://www.forcetalks.com/salesforce-topic/can-we-call-visualforce-page-from-lightning-component/

If you find your Solution then mark this as the best answer.

Thank you!
Regards,
Suraj Tripathi