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
SastryMSastryM 

lightning component in visualforce page

Hi All,

I have created a lightning component and the lightning component should be used in the visualforce page. Created a visualforce page and by lightning out added both app and component in the page, however I am unable to pass the current record Id to the component as I need the current record Id, based on which I am fetching the data.

I request for the help to how to pass the current record Id from visualforce page to lightning component

Thanks in advance
 
Best Answer chosen by SastryM
NagendraNagendra (Salesforce Developers) 
Hi Sastry,

To get a record Id you need to implement the force:hasRecordId interface.
 
One you have done this you can access the record id by:
 
{!v.recordId}
  Hope this helps.

Mark this as solved if the information helps.

Best Regards,
Nagendra.
 

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Sastry,

To get a record Id you need to implement the force:hasRecordId interface.
 
One you have done this you can access the record id by:
 
{!v.recordId}
  Hope this helps.

Mark this as solved if the information helps.

Best Regards,
Nagendra.
 
This was selected as the best answer
SastryMSastryM
Hi Nagendra,

Thanks it worked