You need to sign in to do that
Don't have an account?
Phuc 2
Get object name dynamically in Aura component
Hello
How can I get the object name within an Aura Component based on the record.
Instead of having this while on the Account record:
I want to be able to have this no matter what objetc record I am on:
Thank you,
P
How can I get the object name within an Aura Component based on the record.
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:
<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" />
Thank you,
P
You could create an attribute like parent /ParentType and use the ParentType as input for the objectApiName.
See this related post from past
https://salesforce.stackexchange.com/questions/216748/is-it-possible-to-use-lightningrecordeditform-dynamically-on-different-object-t
If this information helps, please mark the answer as best. Thank you