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
Sankalp JhingranSankalp Jhingran 

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.
 
Amit GhadageAmit Ghadage
Make sure you are invoking component in a record context in Lightning Experience or Salesforce1.