Questions tagged [wrapper-class]

Used for organizing data to be 'Wrapped'. Typically allows for better manipulation or sorting of data.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 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": "...
ZeroX's user avatar
  • 21
0 votes
1 answer
50 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 ...
Sam's user avatar
  • 21
0 votes
1 answer
42 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 ...
uday saitheja's user avatar
0 votes
1 answer
66 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 ...
Unknown_Person's user avatar
0 votes
1 answer
59 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 ...
Patrick Fuller's user avatar
0 votes
1 answer
53 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 ...
Unknown_Person's user avatar
0 votes
1 answer
56 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 "...
Unknown_Person's user avatar
1 vote
1 answer
132 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; ...
sumchans's user avatar
  • 767
0 votes
1 answer
59 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 ...
SFL's user avatar
  • 1
1 vote
1 answer
111 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 ...
code234's user avatar
  • 186
0 votes
1 answer
57 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 ...
Buhuni's user avatar
  • 9
-2 votes
1 answer
268 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 = ...
Hira Khan's user avatar
0 votes
1 answer
55 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 ...
SF Learner's user avatar
-1 votes
3 answers
398 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 ...
SF Learner's user avatar
1 vote
2 answers
165 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 ...
Akash's user avatar
  • 361
0 votes
0 answers
54 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". ...
arghya's user avatar
  • 1
0 votes
0 answers
78 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". ...
arghya's user avatar
  • 1
-1 votes
1 answer
27 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. ...
DanP's user avatar
  • 21
0 votes
0 answers
324 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'...
Rose 's user avatar
  • 131
1 vote
2 answers
585 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; ...
Piotr Gajek's user avatar
  • 2,615
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 ...
abhi ram's user avatar
0 votes
1 answer
142 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","...
Atul Rakate's user avatar
-1 votes
1 answer
159 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 ...
Capt Shaunz's user avatar
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 ...
y0ngleb's user avatar
  • 15
0 votes
2 answers
97 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 ...
Sumit's user avatar
  • 3
-1 votes
1 answer
163 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, ...
TechGuy's user avatar
  • 97
0 votes
0 answers
282 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: @...
TechGuy's user avatar
  • 97
0 votes
1 answer
981 views

Create Dynamic Wrapper class for apex

JSON Response { "subscriptions": { "abc": "suspanded", "def": "ACTIVE", "ghi": "ACTIVE", "...
Avinash Chourasiya's user avatar
0 votes
1 answer
429 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-...
user avatar
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=...
sfdc_cosmokramer's user avatar
-1 votes
1 answer
547 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 ...
Daryn's user avatar
  • 251
0 votes
1 answer
310 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 ...
user avatar
1 vote
1 answer
415 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 ...
CDNHOPHEAD's user avatar
0 votes
1 answer
162 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 ...
MatejN's user avatar
  • 31
-4 votes
1 answer
66 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....
Vidya's user avatar
  • 1
2 votes
1 answer
439 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 ...
user avatar
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; ...
user avatar
-2 votes
1 answer
61 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=&...
user avatar
0 votes
1 answer
195 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 ...
Juliana Marcelino Batista's user avatar
-1 votes
1 answer
216 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{ ...
user avatar
0 votes
1 answer
64 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 ...
Carryonplease's user avatar
0 votes
1 answer
1k 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:...
FenTro's user avatar
  • 29
1 vote
0 answers
255 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 ...
Luke Higgins's user avatar
0 votes
1 answer
208 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 ...
Alexia's user avatar
  • 81
-1 votes
1 answer
412 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 ...
jameshoyles's user avatar
1 vote
1 answer
199 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 ...
Olivia's user avatar
  • 3,451
-3 votes
1 answer
68 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 &...
Sunil Sugave's user avatar
1 vote
1 answer
177 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 ...
Wes's user avatar
  • 41
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) ...
Rose 's user avatar
  • 131
0 votes
1 answer
838 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 { @...
Rose 's user avatar
  • 131

1
2 3 4 5
10