+ Start a Discussion
Daniel Velez 8Daniel Velez 8 

Empty list when passing a list of a instances of a custom apex class in LWC

I have a list of instances of an Apex Class (see the picture)apex class

I am able to show that list in a component (LWC) by using imperative apex calls, but if I pass that list to a child component (LWC) in the child component the javascript shows undefined. It means I can not share a list of instances of an apex class from parent to child.

pcEntryAndOppLine is my variable with the list of instances,

If I do in the parent component javascript this:

this.temp = JSON.parse(JSON.stringify(this.pcEntryAndOppLine));
 

and I share temp instead of pcEntryAndOppLine, then the child LWC will receive the list and will be able to print it in a for loop (I dont know why, I you can help me to understand this also I will appreciate it!)

But if I use that list in the child component inside a for loop that contains another small component (for showing each element of the list) the javascript shows an undefined error, for example when getting the property ".Name".

How Can I have that variable working as another one (I am sharing the record Id and other variables and it works as expected.)

If you need more info please ask for it, thanks in advance.

Carl johnson 18Carl johnson 18
Check this amazing list of GTA 3 cheats Xbox 360 (https://www.gtacheatcode.com/2019/11/gta-3-cheats-code.html)