Instead of having this while on the Account record:
<lightning:card>
<lightning:messages />
<table>
<th>
<lightning:recordForm
aura:id="accountRecordForm"
recordId="{!v.recordId}"
objectApiName="Account"
columns="2"
mode="readonly"
/>
I want to be able to have this no matter what objetc record I am on:
Thank you,P<lightning:card>
<lightning:messages />
<table>
<th>
<lightning:recordForm
aura:id="RecordForm"
recordId="{!v.recordId}"
objectApiName="Object API name based on record"
columns="2"
mode="readonly"
/>
HI Phuc,You could create an attribute like parent /ParentType and use the ParentType as input for the objectApiName.See this related post from pasthttps://salesforce.stackexchange.com/questions/216748/is-it-possible-to-use-lightningrecordeditform-dynamically-on-different-object-tIf this information helps, please mark the answer as best. Thank you