function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SHAIK MOULALI369SHAIK MOULALI369 

aura:set attribute="action" Not working

<lightning:card footer="{!con.Email}" title="{!con.LastName}" iconName="action:add_contact">
            <aura:set attribute="action">
                <lightning:Button Label="View Details" Variant="brand"/>
            </aura:set>
            <p class="slds-p-horizontal-small">
                {!con.FirstName}&nbsp; {!con.LastName} <br/>
                {!con.Phone}
            </p>
        </lightning:card>

For the Above coding i am getting an Error: 
ContactList.cmp: The attribute "action" was not found on the COMPONENT markup://lightning:card: Source.

anyone can help how to solve this.
Best Answer chosen by SHAIK MOULALI369
Akshay Dhiman 63Akshay Dhiman 63
Hi SHAIK MOULALI,

Please define the <aura:set attribute="action"/> above the lightning:card.
<aura:set> is used to set the value of an attribute inherited from a parent component, event, or to set the value of the attribute of a component reference.

Just like this:-
<aura:set attribute="action"></aura:set>
    <lightning:card footer="{!con.Email}" title="{!con.LastName}" iconName="action:add_contact">
        <lightning:Button Label="View Details" Variant="brand"/>
        <p class="slds-p-horizontal-small">
            {!con.FirstName}&nbsp; {!con.LastName} <br/>
            {!con.Phone}
        </p>
    </lightning:card>

Please follow the link below for the solution to your question:
https://www.forcetalks.com/blog/how-to-use-auraset-in-salesforce-lightning/

Hope this explanation will resolve your query. Mark, it as the best answer if you find it helpful.
Thanks
Akshay

All Answers

Akshay Dhiman 63Akshay Dhiman 63
Hi SHAIK MOULALI,

Please define the <aura:set attribute="action"/> above the lightning:card.
<aura:set> is used to set the value of an attribute inherited from a parent component, event, or to set the value of the attribute of a component reference.

Just like this:-
<aura:set attribute="action"></aura:set>
    <lightning:card footer="{!con.Email}" title="{!con.LastName}" iconName="action:add_contact">
        <lightning:Button Label="View Details" Variant="brand"/>
        <p class="slds-p-horizontal-small">
            {!con.FirstName}&nbsp; {!con.LastName} <br/>
            {!con.Phone}
        </p>
    </lightning:card>

Please follow the link below for the solution to your question:
https://www.forcetalks.com/blog/how-to-use-auraset-in-salesforce-lightning/

Hope this explanation will resolve your query. Mark, it as the best answer if you find it helpful.
Thanks
Akshay
This was selected as the best answer
SHAIK MOULALI369SHAIK MOULALI369
Hi Akshay Dhiman,

Thank you for your resolution.