You need to sign in to do that
Don't have an account?

How to pass record id to Lightning component on record detail page
Hi good people,
I'm building a Lightning Experience prototype for the desktop.
I have placed a Lightning component on the Opportunity detail page. This component will display the results of a server-side query that uses the Opportunity id (and other Opportunity data) as filters in the query.
The component is linked to an Apex class (controller="xxx") and implements force:recordTab.
How do I pass details of the Opportunity record through to the Apex class?
Thanks in advance!
I'm building a Lightning Experience prototype for the desktop.
I have placed a Lightning component on the Opportunity detail page. This component will display the results of a server-side query that uses the Opportunity id (and other Opportunity data) as filters in the query.
The component is linked to an Apex class (controller="xxx") and implements force:recordTab.
How do I pass details of the Opportunity record through to the Apex class?
Thanks in advance!
yes, I did solve this:
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}
http://docs.releasenotes.salesforce.com/en-us/winter16/release-notes/rn_lightning_components.htm
All Answers
yes, I did solve this:
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}
http://docs.releasenotes.salesforce.com/en-us/winter16/release-notes/rn_lightning_components.htm
<aura:component controller="CommunityPost_Controller" implements="forceCommunity:availableForAllPageTypes,force:hasRecordId">
<ui:outputText class="form-control" aura:id="recid" value="{!v.recordId}" />
</aura:component>
A description of the set up. Using the Community Builder, I selected New Page > Data Detail Page > selected the object that I wanted > dragged my component onto the page.
My end goal is to create a styled details output, showing only a couple fields for a specific profile of users.
Thanks
- https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_app_builder_record_home_pilot.htm
- https://developer.salesforce.com/page/Lightning_FAQ
- http://salesforce.stackexchange.com/questions/93060/lightning-component-record-id-when-component-in-lightning-page
Could anyone understand if this impossibility to read the recordId of the current record from within a lightning component within a community based on templates is a limitation of the current implementation or if there is a way to have it work? I am using Winter '16.Thanks!
Sebastiano
https://success.salesforce.com/0D53000002PiTVf