Questions tagged [wrapper-class]
Used for organizing data to be 'Wrapped'. Typically allows for better manipulation or sorting of data.
472 questions
3
votes
1
answer
107
views
Salesforce Apex Access Nested Lists after Parsing JSON with Wrapper Class
I think I am just missing something simple - using very simplified and generic code for example.
I have some JSON:
{
"level1":[
{
"level2":{
"id&...
0
votes
1
answer
108
views
Unable to Wrap the Array of Json Object in apex using wrapper class
I am unable to wrap the Array of JSON object in apex using wrapper
JSON
{
"personInfo": {
"firstName": "Sudhanshu",
"lastName": "...
0
votes
1
answer
494
views
Assigning Flow's collection variable with WrapperList generated from Apexaction and loop over
I'm calling an apex action to an invocable method which needs to return a wrapperList. Below is my invocable method & I'm having trouble accessing the returned wrapperList within my flow so that I ...
0
votes
1
answer
155
views
Error: Missing '<EOF>' at 'public' --- > Wrapper class in VFP (pls help)
Apex:
public with sharing class WrapperClassTrainingDealApex {
public Training_Deal__c Tdeal {set; get;}
public Trainer_Master__c Tmaster {set; get;}
//contructor class for ...
0
votes
1
answer
158
views
Visualforce unknown property on inner repeat for wrapper list
When I am trying to reference each of the list values within RowData I get an "Unknown Proprtty" error. When I remove the inner repeat below the table renders with the values that are not in ...
0
votes
1
answer
74
views
How do I adjust this code to access and display multiple object records in a singular Visualforce page table
I have a Visualforce page built by someone a long time ago, and I am trying to add a second object's records to a table that is already displaying correctly. They have the same fields, but different ...
0
votes
1
answer
92
views
VF Page using wrapper in nested repeats
I am trying to return a wrapper class containing two properties and a list. I have a method getTables which is populating a wrapper, and the issue I am running into is when calling them. I have tried ...
0
votes
1
answer
105
views
Variable does not exist, when trying to assign values to wrapper properties
I am trying to create a custom controller and populate a wrapper class that will be used on a Visualforce page. Two unique values and multiple lists of the holdings. I am getting errors that say "...
1
vote
1
answer
255
views
How to extract values of a wrapper class passed as parameters to a apex class method
I have created a wrapper class as below -
public with sharing class GenerateData {
public class Person{
String name;
String addressStreet;
String addressCity;
...
0
votes
1
answer
73
views
Multiple Items in HTTP Request Body Using wrapper [duplicate]
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
193
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
78
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
500
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
58
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
848
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
368
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
72
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". ...
-1
votes
1
answer
29
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
443
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
916
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
3k
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
188
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
182
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
100
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
149
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
229
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
627
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
2k
views
Create Dynamic Wrapper class for apex
JSON Response
{
"subscriptions": {
"abc": "suspanded",
"def": "ACTIVE",
"ghi": "ACTIVE",
"...
0
votes
1
answer
624
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
2k
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
2k
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
450
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 ...
1
vote
1
answer
530
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
180
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
83
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
595
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
1k
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
65
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
233
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
249
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
95
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
2k
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
294
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
279
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
593
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
316
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
95
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
222
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
2k
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
1k
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 {
@...