You need to sign in to do that
Don't have an account?

How to pass record Id to Record view form and lightning datatable on button click?
I have two object Auction(master) and Bid(child). i have used lightning datatable(Aura) to display bid history and record-view form(LWC) to display related auction record. my question is how can I pass the record Id from the Auction detail page to my both the components when someone will click the bid history button on detail page?
Thank You!
Thank You!
I saw you have solved your problem, but I thought I would share any tips just incase you face anything like this again in the future. Or incase anyone else faces this and needs a solution.
You can access the record Id in both of your components(Aura and LWC), irrespective of Bid History button is clicked or not. This means record id will always be available in your component whenever your component will get invoked in a record context in Lightning Experience.
Please follow the following steps to get the record id in your component.
For Aura component
You just need to add following line in the aura component
<aura:component implements="force:hasRecordId">
To fetch the record Id in the JS controller
var idValue=component.get("v.recordId");
Review this link for more detail (https://developer.salesforce.com/docs/component-library/bundle/force:hasRecordId/documentation)
For LWC you could also take the benefit from the salesforce provided way. In the component’s JavaScript class, use the @api decorator to create a public recordId property like:
@api recordId;
When your component is invoked in a record context in Lightning Experience or in the mobile app, recordId is set to the 18-character ID of the record, for example 001xx000003DGSWAA4
Review this link for more detail (https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_record_context)
Let me know if you have any further queries.
All Answers
Hi Raksha
It would be great if you share your code. not able to understand your problem.
https://developer.salesforce.com/docs/component-library/bundle/force:hasRecordId/documentation
Thanks again!
I saw you have solved your problem, but I thought I would share any tips just incase you face anything like this again in the future. Or incase anyone else faces this and needs a solution.
You can access the record Id in both of your components(Aura and LWC), irrespective of Bid History button is clicked or not. This means record id will always be available in your component whenever your component will get invoked in a record context in Lightning Experience.
Please follow the following steps to get the record id in your component.
For Aura component
You just need to add following line in the aura component
<aura:component implements="force:hasRecordId">
To fetch the record Id in the JS controller
var idValue=component.get("v.recordId");
Review this link for more detail (https://developer.salesforce.com/docs/component-library/bundle/force:hasRecordId/documentation)
For LWC you could also take the benefit from the salesforce provided way. In the component’s JavaScript class, use the @api decorator to create a public recordId property like:
@api recordId;
When your component is invoked in a record context in Lightning Experience or in the mobile app, recordId is set to the 18-character ID of the record, for example 001xx000003DGSWAA4
Review this link for more detail (https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_record_context)
Let me know if you have any further queries.