Questions tagged [wrapper-class]
Used for organizing data to be 'Wrapped'. Typically allows for better manipulation or sorting of data.
466
questions
0
votes
1
answer
43
views
Multiple Items in HTTP Request Body Using wrapper
public class test{
public Boolean one{ get; set; }
public Boolean two{ get; set; }
public Boolean three{ get; set; }
public Boolean four{ get; set; }
public ...
1
vote
1
answer
64
views
Unable to view the data in the datatable
I am trying to display the contact record's Name, Phone & Email field on a datatable by bringing the value dynamically from custom metadata records but when I am adding the component on the page ...
0
votes
1
answer
43
views
Assign value to wrapper throw null exception
I have a JSON String Need to pass as request body with configurabale parameter as below.I have used a wrapper class for that called as EmailWrapper , but here assign value to wrapper.options.fieldOne ...
-2
votes
1
answer
145
views
Apex wrapper variable with null values are not returning in LWC [closed]
I have an apex method which is returning Wrapper List.Some of the Wrapper Variables has values as null.Those null values and there variable names are not returning in LWC.
Wrapper Data:
[AccountNo = ...
0
votes
1
answer
53
views
Merging all the query in 1 query and get the different result in variables and pass that to parent class
I was querying the records in different methods based on different conditions but now I have been asked to merge all the queries in one query for efficiency purpose and use of wrapper class. I was ...
-1
votes
3
answers
186
views
how to convert date from yyyy-mm-dd to MMM d, yyyy
I have a date as yyyy-mm-dd and i want to convert it into MMM d, yyyy in Apex. I was trying date method and converting it to string. I have today's date as '2023-07-11' and i want to return it as 'Jul ...
1
vote
2
answers
94
views
Invalid type when assigning values to wrapper
I have a nested wrapper class but I am failing to understand how to assign values to the variables of the nested class.
public class Req_Wrapper {
public Envelope Envelope {get;set;}
public ...
0
votes
0
answers
42
views
how to display filtering option for picklist values to successfully get records in visualforce page,Also how to provide grouping for same record name
I am trying to build one Visualforce page where I am able to get all approval history information. But I am not able to provide users the opportunity to filter records based on "Status". ...
0
votes
0
answers
52
views
how to display filtering option for picklist values to successfully get the records in visualforce page
I am trying to build one Visualforce page where I am able to get all approval history information. But I am not able to provide users the opportunity to filter records based on "Status". ...
-1
votes
1
answer
26
views
Help With Parsing Wrapper Class For Xero Contact
I am trying to update a Xero contact with Payment Terms when a salesforce account is updated. I extracted the json for a contact using Postman and then used json2apex to generate the wrapper class. ...
0
votes
0
answers
262
views
Not able to Read Javascript Object passed from LWC to Apex Method
I would like to the read the Javascript Object response passed from LWC to Apex Method.
I have a requirement where SAP_Account__c custom object there exist a quantity 'Variable Quantity' field which I'...
1
vote
2
answers
381
views
How to populate wrapper's properties?
The question is about the best practices when working with the Wrapper class.
Assumptions
We have PersonWrapper.
public class PersonWrapper {
private String id;
private String firstName;
...
0
votes
1
answer
2k
views
LWC DataTable with Account Records with checkbox and Submit Button
I have an LWC component with 10 Account Records with a checkbox and submit button. My question is: Whenever I select multiple Account Records, modify Account field values, and click on the submit ...
0
votes
1
answer
134
views
How to deserialize JSON array which contains custom fields? Passing data from LWC to APEX
I have an array JSON which contains custom fields as well as some other data as below,
jsonString = '[{"Id":"a2l0E000000WFL2QAO","Name":"TCIP-0000022","...
-1
votes
1
answer
133
views
How to put values (to be JSON serialised) in an inner class which has an array
My requirement is to send data from my salesforce org to an ext org (SAP S4). I have successfully integrated the same by creating an http apex class which sends data from my org to SAP on executing ...
0
votes
0
answers
97
views
Apex Custom Wrapper wrong property assignment
I've created the following wrapper:
public class MyWorkWrapper {
public String sobjectName;
public String ownerName;
public String recordId;
public String recordNumber;
public ...
0
votes
2
answers
68
views
getting duplicate element in List
Kindly advise what I am doing wrong here. I am getting the output like
[{"ItemId":"Item C"},{"ItemId":"Item C"},{"ItemId":"Item C"}]
Instead ...
-1
votes
1
answer
137
views
Nested Query for LWC [duplicate]
public static List<WrapperToLWC> getList(String namee){
Id cleanId = (Id) namee;
List<SObject> membersList = new List<SObject>();
membersList = [SELECT Id, SObject1, Rol, ...
0
votes
0
answers
199
views
Pass wrapper to LWC in datatable
Hello guys I am trying to pass a List of WrapperToLWC from an Apex class to a JavaScript file in order to get the wrapper and show its information in a lightning-datatable.
My Wrapper is this:
@...
0
votes
1
answer
740
views
Create Dynamic Wrapper class for apex
JSON Response
{
"subscriptions": {
"abc": "suspanded",
"def": "ACTIVE",
"ghi": "ACTIVE",
"...
0
votes
0
answers
72
views
Add node when data Javascript LWC
Hello everybody I am working with a LWC form. In my .js I create a json wrapper to pass the user inputed information to an Apex controller to validate each one of the data. Such as this:
cliente:{
...
0
votes
1
answer
348
views
Populate input field with data LWC problems
Hello everybody I am currently working on a Flow that receives the Id from the record where the LWC action is and pass it to the LWC.
The LWC is a form that shows some lightning-input and lightning-...
0
votes
2
answers
1k
views
Access List<sObject> stored inside a wrapper list
I am trying to iterate through the list which is stored inside a wrapper list. I want to extract a field value from it and store inside a Set (wrapper again).
Here is my code -
@AuraEnabled(cacheable=...
-1
votes
1
answer
174
views
QUEUEABLE TEST CLASS
I have a request to create a queueable test class where the test class is to use @testsetup using a testdatafactory returning a complex wrapper class.
The idea is the testDataFactor should populate ...
0
votes
1
answer
251
views
Problem to show String list in Show toast event
Hello everybody I am working with a LWC form that gathers the information from the user and send it to an apex function that validates the data. If this data is incorrect it send the list of errors of ...
0
votes
0
answers
143
views
Show list of error in ShowToastEvent LWC
Hello everybody I am currently working with a LWC form that gathers information from the user and send it to an apex class that verifies if the data from the user is correct. In case of not being ...
1
vote
1
answer
360
views
Issue with formatting JSON for Rest API Post Request
First-time poster here so feel free to give me pointers on forum etiquette. I have been trying to teach myself Apex the past 2 months and I have a personal project that I am working on that involves ...
0
votes
1
answer
135
views
wrapper not defined ERROR - LWC
I am complete novice to JS and LWC. I am trying to pass multiple params to ma APEX class. And still getting "[wrapper is not defined]" In the example, i am passing just one string. The goal ...
-4
votes
1
answer
59
views
Error: illegal assignment list to list [closed]
@RestResource(urlMapping='/Contact')
global class WSgetcontact {
@HttpGet
global static list<contact> doGet() {
WSgetcontact.contactproductwrapper result = new WSgetcontact....
2
votes
1
answer
326
views
Apex method receives null
Hi everybody I am trying to pass a wrapper from LWC to an apex class. The wrapper in js has the structure of the Apex class and the method that receives this wrapper is:
@AuraEnabled
public static ...
0
votes
2
answers
909
views
Send wrapper from LWC to APEX
Hi everybody I am trying to send a wrapper from LWC to an apex class. For that I have the function handleValidation which is triggered when the user clicks the button validate:
wrapperToApexClass;
...
-2
votes
1
answer
56
views
fill json with data
Hi everybody I am trying to do a LWC form where the user inputs some values and with them populates a json.
So for example I have the lightning-input:
<lightning-input type="text" label=&...
0
votes
1
answer
163
views
wrapper class does not match with json resulted from POST request
I have this apex class (coded by another developer)
@RestResource(urlMapping = '/thunder/contapj/*')
global class Thunder_SVC_ContaPJ {
public static Log_de_Integracao__c log = new ...
-1
votes
1
answer
190
views
Create wrapper of classes in apex class
Hi everybody I want to instance an apex class in my LWC so I founded that in the apex class I have to create a wrapper. My apex class I have inner classes like these ones:
public class HospitalClass{
...
0
votes
1
answer
50
views
Should I be using a better OOP pattern (DI, Factory?) for this API callout with a big wrapper class
I'm trying to up my OOP game and utilize good patterns where I can. Recently I wrote some classes that essentially take a custom object (a quote) and build a very long/complex api request body using a ...
0
votes
1
answer
845
views
How can I pass the results of wrapper class to aura component?
How can I display the results of my wrapper class in aura component?
The debug of my apex controller shows me the correct results, but I can't pass the results to my component.
COMPONENT
<aura:...
1
vote
0
answers
228
views
lightning tree grid not removing data on filter change
I have a lightning-tree-grid with a filter. When I initially select a value in the filter, it works fine. However, when I change the filter to a new value, the previously pulled records remain in the ...
0
votes
1
answer
176
views
How compare wrapper values with a map?
I have a callout that return a response on JSON with "CdOrder" and I have Order__c field on User object.
I need to compare the CdOrder that is on a Wrapper with a Map that has the key with ...
-1
votes
1
answer
376
views
Write test class for wrapper
I have a wrapper class that I can't seem to get more than 20% coverage on, can someone help? Here is the controller code:
public class Add_QLI {
public String opportunitystringId {get;set;}
public ...
1
vote
1
answer
149
views
Nested Compareable Methods on Wrapper Class
I have a wrapper of Tasks and Events that I want to sort by: ActivityDate then by LastModifiedDate then by CreatedDate (all in descending order)
My initial thought was to do the comparable interface ...
-3
votes
1
answer
63
views
How to Convert Custom Controller to Standard Controller, I want to add VFP to Page layout, can anyone please help me with this [closed]
<apex:page controller="TrainingDeal" >
<apex:form >
<apex:pageMessages />
<apex:pageBlock id="pg">
<apex:pageBlockSection &...
1
vote
1
answer
147
views
Create map from list and set where set value matches value in list
I have an apex class that is parsing json responses from a few apis.
The result is having a set and a list from the responses and I would like to map them together where the map key would be the value ...
0
votes
1
answer
1k
views
Getting Error: System.TypeException: Invalid conversion from runtime type List<ANY> to Map<String,ANY>
I'm getting error in the following apex method: System.TypeException: Invalid conversion from runtime type List to Map<String,ANY>
Please find the apex method:
@AuraEnabled(cacheable=true)
...
0
votes
1
answer
743
views
LWC : How to Map Wrapper Class Values in Lightning datatable fieldname
Is it possible to map wrapper values in lightning datatable fieldname. I'm not able to map the values in the fieldname.
Please find the code below:
Wrapper:
public class AccountsResponse {
@...
0
votes
1
answer
106
views
How can I update wrapperlist item
How can I update the wrapperlist item with the value of the second for loop? Always the wrapper adds the whole information (see my screenshot). Also I don't know how can I display the result at a ...
0
votes
1
answer
23
views
Wrapper resultlist will not appear at my visualforce page
The resultlist of my wrapper will not appear at my visualforce page. The debug log shows me that something is in the resultlist, but nothing at my visualforce page.
public class Camp_Letter {
...
0
votes
2
answers
1k
views
How to loop through in a wrapper class and print data in an another class
Wrapper class:
public class Check_Request_Response_WS {
public root root{get;set;}
public class root{
public list<ACC_DOCUMENT03> ACC_DOCUMENT03{get;set;}
public ...
0
votes
1
answer
49
views
How can I use other map identifier
For my campaign I need some additional information form a custom object PC_List__c. In this list I have more information (e.g. salesrep) about the postcode.
I use a wrapper to collect the data of the ...
0
votes
1
answer
273
views
Enum property is not visible in Flow
I have flow which is using Enum property and trying to access in the flow, but for some reason it not showing up,
Enum Property
Wrapper class
Not showing up in Flow
Any clue will be highly ...
0
votes
1
answer
34
views
Can't add custom class to list
I have custom Wrapper class
public without sharing class OppProdWrapper {
public String Name;
public Decimal UnitPrice;
public Decimal TotalPrice;
public OppProdWrapper(String ...