3 votes
Accepted

Unable to view the data in the datatable

Data tables iterate over Arrays, not Objects. The following line of code... this.data = {...data}; ...ends up changing the Array you returned into an Object, where each key is the index array: { '0': ...
sfdcfox's user avatar
  • 481k
2 votes
Accepted

How to populate wrapper's properties?

There are two anti-patterns in what you mention that I would avoid. One is use of long parameter lists (which the builder pattern avoids). The other is loosely typing your data. Your controller layer ...
Adrian Larson's user avatar
  • 149k
2 votes
Accepted

getting duplicate element in List

When you declare a variable, you are declaring that you would like to hold a "reference" (memory address) of an object in the "heap". The variable only holds a memory address that ...
sfdcfox's user avatar
  • 481k
1 vote
Accepted

Multiple Items in HTTP Request Body Using wrapper

Your JSON is invalid. You can use the JSON Viewer or JSONLint to validate the JSON. Suppose your JSON is like this: {"data":[{"TOne":"First","TTwo":{"one&...
Tushar Jadav's user avatar
1 vote
Accepted

How to deserialize JSON array which contains custom fields? Passing data from LWC to APEX

You're going to have to choose one: (a) rename Amount_Kg to be a proper custom field, and then use the custom object directly, or (b) rename the properties in your wrapper class to not use __ in the ...
sfdcfox's user avatar
  • 481k
1 vote
Accepted

Assign value to wrapper throw null exception

You defined emailOptions at the beginning of your method (a new EmailOptionAttributes) but are not doing anything with it, as instead you're trying to access wrapper.options that is null at this point....
user1067017's user avatar
1 vote

how to convert date from yyyy-mm-dd to MMM d, yyyy

Dates can be coerced into Datetime, the "gotcha" to look out for here is that doing so means Salesforce treats it as if the Datetime is in the GMT (UTC +0) timezone. With that in mind, you ...
Derek F's user avatar
  • 59.4k
1 vote
Accepted

Invalid type when assigning values to wrapper

When you're not working inside of the Req_Wrapper class, you need to use the outer class name as well when you reference inner classes. e.g. Req_Wrapper.Envelope and Req_Wrapper.Header So the code you'...
Derek F's user avatar
  • 59.4k
1 vote

Help With Parsing Wrapper Class For Xero Contact

I've found the answer. The problem was that the Sales property of the paymentTerms object is null. To resolve the NullPointerException, I instantiated the Sales property before assigning a value to ...
DanP's user avatar
  • 21
1 vote

How to populate wrapper's properties?

Do we need private properties? It's just a wrapper class. Is there any reason to not expose wrapper properties? You might need to use @JsonAccess, @AuraEnabled, public, global, and/or { get; set; }, ...
sfdcfox's user avatar
  • 481k

Only top scored, non community-wiki answers of a minimum length are eligible