Questions tagged [wrapper-class]
Used for organizing data to be 'Wrapped'. Typically allows for better manipulation or sorting of data.
472
questions
1
vote
2
answers
1k
views
Lightning Web Component not loading while using Lightning-Input with Wrapper class variable
I am trying to build a simple Lightning Web component to allow capturing both parent and child record details on single form. To explain i am taking an example of capturings single Account and Contact ...
1
vote
1
answer
4k
views
Lightning Datatable with wrapperclass
How can I use my wrapperclass with a lightning:datatable, Is that possible?
At the moment I use
<apex:pageBlockTable value="{!wrapperList}" var="wl" title="all activities&...
3
votes
2
answers
1k
views
List on Wrapper class not visible in lightning component
I have an Aura component and I want to iterate through a wrapper class of objects, which has two lists as properties. While I can iterate through the wrapper class list, my lists come up as null when ...
0
votes
1
answer
979
views
Assigning Custom Setting value to Custom object Field
/***********Custom setting **********/
Map<string, CountryCO__c> codes = CountryCO__c.getAll();
string pb;
list<string> pb1=new list<string>();
for (...
0
votes
1
answer
1k
views
Use of getter and setter methods for each field in Wrapper classes
I understand that wrapper class is like a custom object that you can define in an Apex class but I am not sure why getter and setter methods are used for each field in a wrapper class. What is the ...
3
votes
1
answer
80
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
72
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
4k
views
global methods do not support return type of wrapperclass
i am getting of error
global methods do not support return type of ContractResponseWrapper
line is global static ContractResponseWrapper postMethod()
i think i could'nt able to send wrapper class ...
0
votes
1
answer
283
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
116
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
131
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
78
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 ...
3
votes
2
answers
6k
views
Getting error : Nested object for polymorphic foreign key must have an attributes field before any other fields
My mock body looks like :
'{"totalSize": 1, "done":true,
"nextRecordsUrl":"WWW.testurl.com","records":[{"Name":"Fund1", "...
0
votes
1
answer
69
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
90
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
213
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
68
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
162
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
532
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
1
answer
76
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 ...
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=...
-2
votes
1
answer
442
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
3
answers
2k
views
Error: Malformed JSON: Expected '[' at the beginning of List/Set
JSON Response:
{
"caPerformanceRecordList": [
{
"motorDealerID": "XL1HX",
"dealerName": "Subaru Auto Dealer",
"reportingPeriod": "2019-05-18",
"...
-1
votes
3
answers
729
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 ...
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
vote
2
answers
316
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
63
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
429
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'...
0
votes
1
answer
1k
views
Wrapper class and displaying data in table lightning
Need your help in structuring my wrapper class.
Price agreement Header (Parent): Has 3 child.Distributor object : Distributor_Eligibility__c ,Product :Product_Pricing__c,Enduser object ...
1
vote
2
answers
825
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
181
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
173
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
99
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
136
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
216
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
540
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
1k
views
Create Dynamic Wrapper class for apex
JSON Response
{
"subscriptions": {
"abc": "suspanded",
"def": "ACTIVE",
"ghi": "ACTIVE",
"...
0
votes
1
answer
458
views
How to display related custom object in VF using wrapper class according to the user input
Public class Patients
{
Public Integer pID{get;set;}
Public Date sDate{get;set;}
Public Date eDate{get;set;}
Public List<wrapPatientInfo> listOfPatients {get;...
-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
409
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
508
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 ...
-4
votes
1
answer
78
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....
0
votes
1
answer
174
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 ...
2
votes
1
answer
563
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=&...
-1
votes
1
answer
245
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
232
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 ...