1

I'm trying to use @wire with a method that returns a list of my custom wrapper class. The list is returned, but the items have no fields. When I'm using @wire with List of SObject, everything is fine.

  • 1
    Can you add code snippet? also are the fields in your wrapper class annotated with @AuraEnabled? – Pranay Jaiswal Jun 7 '19 at 20:21
  • That's it! I forgot about @AuraEnabled on the fields. Thanks a lot! :) – mmm321321 Jun 7 '19 at 20:25
6

When you declare a Apex wrapper class to be used in Aura or LWC, you have annotate each and every field with @AuraEnabled else they won't be visible in the JS or Markup of lwc or aura.

|improve this answer|||||

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.