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': ...
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 ...
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 ...
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&...
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 ...
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....
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 ...
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'...
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 ...
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; }, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
wrapper-class × 466apex × 295
visualforce × 154
lightning-web-components × 45
json × 42
lightning-aura-components × 29
unit-test × 29
class × 29
controller × 21
soql × 18
map × 18
list × 18
javascript × 17
lightning × 16
rest-api × 14
code-coverage × 14
lightning-datatable × 13
pageblocktable × 13
comparable × 11
sort × 9
deserialize × 8
inputcheckboxes × 8
trigger × 7
repeat × 7
inner-class × 7