You need to sign in to do that
Don't have an account?
Uncaught Error in $A.getCallback() [Cannot read property 'Account__c' of null]
I am getting the following error:
Uncaught Error in $A.getCallback() [Cannot read property 'Account__c' of null]
when I try to set a variable in my JS Helper class of my Lightning component.
It occurs at the following lines:
If I look at the console, I can see that parentRecordId is set, and a
field exists on the object called Account__c.
Can anyone explain what this error indicates and how to resolve it?
Thanks
Barry
Uncaught Error in $A.getCallback() [Cannot read property 'Account__c' of null]
when I try to set a variable in my JS Helper class of my Lightning component.
It occurs at the following lines:
console.log('Parent Id is '+parentRecordId); component.set('v.addressDetails.Account__c', parentRecordId);
If I look at the console, I can see that parentRecordId is set, and a
field exists on the object called Account__c.
Can anyone explain what this error indicates and how to resolve it?
Thanks
Barry
You cannot set the attribute of addressDetails directly with component.set(). Instead, try the following: Regards,
Mkr
All Answers
You cannot set the attribute of addressDetails directly with component.set(). Instead, try the following: Regards,
Mkr
Thanks for the response, but I get exactly the same error using your code.
Right, are addressDetails already populated? So should there be an object already assigned to it?
If not, you should do something like this:
Regards,
Mkr
That solved it, my addressDetails object was empty.