You need to sign in to do that
Don't have an account?
Badal Shinde
Pass list attribute from lightning component to apex controller and fetch record data dynamically
I wanted to try pass the object Name and thier related query by using design attribute and show the records on app page but I have no idea how to do this. please help me.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:attribute name="objectName" type="String" /> <aura:attribute name="Query" type="String" /> <aura:handler name="init" action="{!c.doInit}" value="{!this}"/> <lightning:card> test </lightning:card> </aura:component>
<design:component> <design:attribute name="objectName" Label="Object Name"/> <design:attribute name="Query" Label="Query"/> </design:component>
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:attribute name="objectName" type="String" /> <aura:attribute name="Query" type="String" /> <aura:handler name="init" action="{!c.doInit}" value="{!this}"/> <lightning:card> test </lightning:card> </aura:component>
<design:component> <design:attribute name="objectName" Label="Object Name"/> <design:attribute name="Query" Label="Query"/> </design:component>
I see you also posted on https://salesforce.stackexchange.com/questions/392104/pass-list-attribute-from-lightning-component-to-apex-controller-and-fetch-record
Copying related code from above post:
You just need some Apex code to complete the project:
And in your component markup:
And in your doInit method:
Please consider marking the answer as best to close the thread so others can find it helpful too. Thank you