In lead object I have a lookup called Project_Name__c. How can I get the Id of the field in Javascript instead of value.


<aura:attribute name="mainleadRec" type="Lead" />


var projName1 = component.get("v.mainleadRec.Project_Name__c");

1 Answer 1


Use aura:event to get the Id value. Fire an event when clicked on a record and send Id value using event's aura:attribute.

<aura:event type="COMPONENT">
    <!-- pass context of where the event was fired to the handler. -->
    <aura:attribute name="context" type="String"/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .