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
shailendra singhaishailendra singhai 

i want to send Sobject to VF page, by clicking upon button present upon lightning component. getting issue that like @auraenabled class can't have the page reference

i want to send Sobject to VF page, by clicking upon button present upon lightning component. getting issue that like @auraenabled class can't have the page reference
Could you please share any idea here,
I want to send Sobject to VF page, by clicking upon button present upon lightning component. getting issue that like  @auraenabled class can't have the page reference;

Actual requirment is.
A lightning tab 'ABC' hvaing component which contain some record onclick upon tab (through integration we picked the data) , that responsewe kept into object. i need on the same component a new button to create , and onclick this object dta move to VF page and VF page should be in PDF with functionality of email feature. 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Shailendra,

Greetings to you!

Communicating between Lightning Component and Visualforce Page can be tricky as both are hosted on different domains.
For example, if your org URL is “https://myorg.lightning.force.com/” then:
Lightning Component would be hosted on https://myorg.lightning.force.com/
Visualforce Page would be hosted on https://myorg–c.ap5.visual.force.com/

Use postMessage() function to send the data to a different domain.

Please refer to below links which might help you further.

https://developer.salesforce.com/blogs/developer-relations/2017/01/lightning-visualforce-communication.html

http://sfdcfacts.com/visualforce/share-data-between-lightning-component-visualforce-page/

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas