I'm working on a lightning component and I'm trying to retrieve lead record details through force:recorddata but actually it's returning null results.
My component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="leadRecord" type="Object"/>
<aura:handler name="init" value="{!this}" action="{!c.dohitme}"/>
<force:recordData aura:id="recordLoader"
recordId="{!v.recordId}"
fields="status"
targetFields="{!v.leadRecord}"
targetError="{!v.recordLoadError}"
/>
</aura:component>
My Controller:
({
dohitme : function(component, event, helper) {
var userId = $A.get("$SObjectType.CurrentUser.Id");
console.log(userId);
console.log(component.get("v.recordId"));
var speedtolead = component.get("v.leadRecord").Status;
console.log(speedtolead);
}
})
Did I miss something?