1

Assume we have a Lightning component.

<aura:component implements="force:lightningQuickAction" >
    <aura:attribute name="test" type="String"/>

    Display dynamic text passed on button click from Global Publisher Layout or Object Specific Layout
    {!v.test}
</aura:component>
enter code here

This component is declared as a Global Action (and it is put on Global Publisher layout). enter image description here

Also the same component is declared as Object-Specific Action (and it is put on corresponding Object Layout, so the button is visible). enter image description here

Is there any way to pass some parameters like current viewed record Id or some other attributes of current record by a button click?

2

Looks like it is possible to pass at least RecordId

The component should implement force:hasRecordId interface and have a property

<aura:attribute name="recordId" type="String" />
| improve this answer | |
  • You do not need to declare your own aura:attribute, as force:hasRecordId defines it for you. – sfdcfox May 15 '17 at 13:35
1

To get a record Id you need to implement the force:hasRecordId interface. One you have done this you can access the record id by: {!v.recordId}

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.