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

Not able to get the recordId in a Lightning component called from a quick action of Case record
I have a very simple Lightining component included in Chatter of a case record, and I am trying to get the recordId of the case, but its coming as 'undefined'. As per the docs, I have implemented force:hasRecordId marker interface.
Component:
<aura:component implements="force:lightningQuickAction,force:hasRecordId">
<!-- recordId is always empty here -->
Record Id is =====> {!v.recordId}
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>
Controller:
({
doInit: function(component, event, helper) {
console.log(component.get("v.recordId")); //debug console shows 'undefined' here
}
})
Is there anything I am missing here? Thanks in advance.
Component:
<aura:component implements="force:lightningQuickAction,force:hasRecordId">
<!-- recordId is always empty here -->
Record Id is =====> {!v.recordId}
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>
Controller:
({
doInit: function(component, event, helper) {
console.log(component.get("v.recordId")); //debug console shows 'undefined' here
}
})
Is there anything I am missing here? Thanks in advance.

Make sure you are invoking component in a record context in Lightning Experience or Salesforce1.