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

How to pass Record Id from Parent component to Child component in Aura
Hi..,
I am calling the Child component from the Parent component..so, it is successfully done.
but
along with that i want to pass the Record Id from Parent component to Child component using Aura component.
Thanks
I am calling the Child component from the Parent component..so, it is successfully done.
but
along with that i want to pass the Record Id from Parent component to Child component using Aura component.
Thanks
Please use the sample code:
1. Create one attribute in Child Component.
<aura:attribute name="recordId" type="String" />
2. Pass the id from parent to child like below.
<c:ChildComponent recordId="{!v.recordId}"></c:ChildComponent>
Parent Component :
Child Component:
Thanks,
Maharajan.C
Please follow below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
You can use recordData in your component firstly you get the RecordId via force:hasRecordId then you can achieve the recordData in your component with that you can achieve your parentId in the same component
Below is the given syntax.
<force:recordData
fields="CaseNumber,ParentId,AccountId,"
recordId="{!v.recordId}"
targetFields="{!v.Childcaseno}"
targetError="{!v.recordError}"
recordUpdated="{!c.handleRecordUpdated}"
/>
Hope you find your solution
Thakns