You need to sign in to do that
Don't have an account?
Ken Koellner @ Engageware
Get Id field from object in lightning component code.
I have an attribute that's an sObject like ---
I can get to all the fields via API name except Id. A reference like {!v.myAttr.id} does not work. A reference like {!v.myAttr.Name} works fine.
Is there some magic word to get the Id field from an Object in Lighting.
<aura:attribute name="myAttr" type="MyCustomObject__c"/>
I can get to all the fields via API name except Id. A reference like {!v.myAttr.id} does not work. A reference like {!v.myAttr.Name} works fine.
Is there some magic word to get the Id field from an Object in Lighting.
It is just the lower/upper case problem most of the time. {!v.myAttr.Id} "I" upper case.
All Answers
It is just the lower/upper case problem most of the time. {!v.myAttr.Id} "I" upper case.
BTW, here's a real useful line of code I wrote to figure that out....
I put that in the controller righter after myAttr is assigned a value.