0

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.

CMP

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

JS

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

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.

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

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.