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");

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"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.