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
1answer
24 views

Unknown property in Visualforce with wrapper class

I need to call a vfp from a new lwc that I'm developing, the link seems to be working fine, since the vfp is opening, but is not calling the process method of apex controller, that will display ...
0
votes
1answer
34 views

Illegal assignment from List to List

i'm facing the following error while trying to save this. can someone tell me what im doing wrong please? public class GanttDTO { public class RecordDetail { @AuraEnabled public String identifier;...
0
votes
1answer
49 views

user defined apex class

I need to build a wrapper that could essentially hold this format. { record: { id: 123 name: abc start: 1-jan end: 31-jan status: completed records: [{ ...
0
votes
1answer
20 views

Trying to Display Information in a Wrapper Class in a pageBlockTable

I recently began working on integrating my Salesforce org with the NPPES NPI Registry. Ideally, I'd like the code to be able to send a callout to the NPPES Registry and query the NPI number and ...
0
votes
1answer
62 views

Wrapper class showing error 'Inner types are not allowed to have inner types' in apex

I am trying to create a wrapper class to hold the JSON response in my apex class. But I am getting the error ' Inner types are not allowed to have inner types '. Below is my wrapper class. public ...
2
votes
1answer
39 views

Insert Parent Child records from Wrapper

I have a wrapper class which has one attribute for Parent record and another list of child records. I'm getting this list of wrappers from my lightning component. Now I need to insert these records. ...
0
votes
1answer
17 views

Constructor not defined error - error after setting date fields as null during object creation

I have created a wrapper class to create an Object and send it as a request to a third party system. It was working well. But after I added a two new arguments of the Datatype Date, I am getting the ...
1
vote
1answer
25 views

Adding list data to a test class

global class AcquirersPJRestWrapper { global String codOffer; global String channel; global List<Technology> technologies; } global class Technology{ global String ...
0
votes
1answer
58 views

Duplicate @AuraEnabled methods in 2 separate Apex Controllers, is it really code duplication?

so recently our code sniffer flagged 2 methods in 2 of our Apex controllers as "duplicated code" and I'm wondering if this is a false positive in this case, see example below. Both ...
0
votes
0answers
25 views

REST callout to another org - unable to access custom field due to it ending with __c [duplicate]

I am making a callout from my org to the REST endpoint of another org in our business. This is using the standard query endpoint /services/data/v48.0/query?q=SELECT+Fields+FROM+Contact+WHERE+.... ...
0
votes
1answer
59 views

How to Parse return list Wrapper in LWC javascript

I'm new to lwc as well as javascript . I have an Apex class returning List into the Lwc. Method used in LWC: if ( strLastName ) { getAssets( { strLastName } ) .then(result =...
0
votes
1answer
27 views

How to reference a field from an object defined in wrapper class?

I need to access fields from objects I declared as variables in a wrapper class. I tried to refer to them using dot notation, however the following form is not working: wrapper.object.field Class ...
0
votes
1answer
27 views

How to set checkbox for unit testing, but it is inside a wrapper class?

I have an apex class that steps a user through a visualforce page. They select a product family and then are presented with a list of products. They can then select one or more of these, via a ...
0
votes
0answers
21 views

Code coverage aggregate result in test class for VF user input page [duplicate]

I'm having a hard tome covering the wrapper class for an aggregation in a test class. I'm only getting 48%. Can anyone see what I am missing? This Apex supports a VF page, where the user selects the ...
0
votes
0answers
20 views

Cover aggregate Result Wrapper Class in test class [duplicate]

I'm having a hard tome covering the wrapper class for an aggregation in a test class. I'm only getting 48%. Can anyone see what I am missing? This Apex supports a VF page, where the user selects the ...
1
vote
1answer
25 views

JSON Wrapper Class not Deserializtion

I have some JSON coming in that's like this (data removed for privacy reasons. {"user":{"id":"","email":"","first_name":"","...
0
votes
1answer
133 views

Lightning Web Component - Combo box - populate value from Wrapper Class

I am trying to populate a list of contacts from the Wrapper class.However, I am not getting any values to display in the Combo box. Here are my codes Apex Controller Class: public with sharing class ...
0
votes
0answers
20 views

Passing Id of a record from apex:inputfield lookup to controller and not the record Name

I have a VF page with a table populated by a wrapper class and some lookup inputs above it. I've created a method to update a column value for all the table rows to match whatever is selected in the ...
0
votes
1answer
17 views

How to show fields from multiple objects in Visualforce Page string

I have created a visualforce page to display as txt, so that when a button is clicked, a txt file is downloaded to the computer. I need this txt document to be a comma-separated collection of fields. ...
0
votes
0answers
23 views

How do I write the test class for List input and output [duplicate]

How do I make a test class for this getOrderStatus below. Input value is List of undefined Object( we do not have this in our object) and Output is also. public with sharing class ...
0
votes
1answer
58 views

Variable to hold the return of type wrapper class from a method

I have a class and a method. In the method I am calling another method of another class - Class2.Method2 The return type of method 2 is a wrapper class. What should be the variable type in my method 1 ...
1
vote
2answers
109 views

How to deserialize list with map to wrapperclass

I have a string which I am trying to deserialize to a wrapperclass / object. But get the error: Expected Map<String,String> but found [line:1, column:3] Wrapperclass global class ...
3
votes
1answer
105 views

How can I use a reserved keyword as an identifier in my JSON wrapper class

From salesforce Trying to Create PayPal payment, In Create Payment method request object has Items with Currency like below "name": "hat", "description": &...
2
votes
1answer
104 views

How to serialize a string into a Blob value without backslashes?

I have a Map<string, String> that is populated using the following code below. When I attempt to convert this into a serialized string so that it can be passed into Blob.valueOf, the \" (...
-2
votes
2answers
37 views

How to have inner class inherit fields from outer wrapper?

We want to be able to have the inner wrapper class inherit fields from the outer wrapper class. How can we do this? Current setup: public class ContactWrapper { public String firstName; public ...
1
vote
1answer
280 views

LWC Wrapper List Update not reflecting in client side JS or Apex

I have an LWC as shown in below diagram. Whenever I update these checkboxes these changes are not being communicated to JS property variable any help would be really appriciated. Html <template&...
0
votes
1answer
142 views

Prevent Duplicates Using Wrapper Class in Apex Class

Note* I am a beginner attempting to jump from level 1 to level 10 coding because there is no easy way to accomplish the task. I need to prevent users from inserting duplicates of a custom object ...
0
votes
1answer
26 views

Test class for Wrapper Class Method

I have wrapper class WrapperDemoClass, writting test class for this getwrapperObj method. in the below test class how to read the wrapper class return list from test class. Getting In valid type ...
0
votes
1answer
241 views

LWC - Javascript object is not reactive with Wrapper class object

Could you please guide me how to make the wrapper class object reactive in LWC js. I believe that @track properties are reactive but when I change the value of any property in this.coreAttributes js ...
0
votes
2answers
69 views

How can I assign field values from an Object instance dynamically via a predefined wrapping?

I have a Wrapper object that I'm using to store values via calculations and callouts. I want to map these values to a custom object's fields. I also have a custom metadata type where I'm storing the ...
1
vote
1answer
24 views

Display Leads and Accounts in same <apex:panelGrid>

In my controller I query for leads and accounts to display them in a googlemap and also in a panelGrid: However what I fail to achieve is to display the leads and accounts in the same panelGroup and ...
0
votes
0answers
19 views

JSON Wrapper with APEX: prepping for Salesforce Dev 1 cert

I'm studying up for my exam and found this code sample. It's syntax is unclear to me. mainly the .class and the getter and setter. I noticed that I can take any prop from the serialized object and ...
-1
votes
1answer
41 views

Wrapper Class in Apex

Can anyone please help me what wrong in the below code. I'm getting. Illegal assignment from List to List in aWraper.items = spwrap; this line. @AuraEnabled (cacheable = true) public static List&...
0
votes
1answer
52 views

How to fetch opportunity fields on a nested query included process instance and steps and work items

I've been struggling for quite some time now to figure out a way to provide the approvers within my company with a list of opportunities that are pending approval and by whom (we have two parallel ...
0
votes
1answer
2k views

LWC Lightning Datatable Search

I am trying to build a lighting web component which uses lightning datatable with Server side search capabilities. here is the code: I am not sure what I am doing wrong. .HTML <template> ...
-1
votes
1answer
104 views

What is a wrapper class in LWC?

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 setter methods are used for each field in a wrapper class. Can anyone please ...
0
votes
0answers
30 views

Apex Rest API response does not fetch fields with null values [duplicate]

I have created an apex api with a SOQL query to get opportunity, its related contact, account , line items and payment based on an ID. The API response does not get the fields for which the value is ...
0
votes
2answers
599 views

How to check for null values for all variables of a custom apex wrapper?

I have a wrapper class written in following manner class Wrapper{ String name {get;set;} Integer age {get;set;} EduWrap edu {get;set;} public String returnTest(){ return '...
0
votes
1answer
124 views

How to jenerate JSON format using wrapper class?

Please see the below code I have done some modification, @RestResource(urlMapping='/instructionsRestCall/*') global with sharing class InstructionsRestService { @HttpGet global static List ...
0
votes
1answer
112 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 ...
0
votes
1answer
42 views

Get contacts created by lead conversion

I was stuck at a point where I need to get the contacts created by lead conversion. Can someone tell me how to query those contacts when a lead is converted... I am new to salesforce so please help me ...
0
votes
1answer
28 views

I am getting null pointer exception because not able to initialize List

I am getting null pointer exception when adding referral data in List. I am not getting how to initialize List inside Messages class. public class JSON2Apex { public class Messages { ...
0
votes
1answer
112 views

Wrapper Class Error on Account Hierarchy

I have created one VF page which is on Account object to show the Account Hierarchy at the parent level. Basically this VF page will show Contracts of all child Accounts on parent account. I have ...
0
votes
1answer
76 views

How to call an Apex method with Wrappers parameters from managed package?

I know, how to access to such a method: packageName.MyGlobalClass.doWork(); But what if our method gets a Wrapers parameters? Like this: global with sharing class MyGlobalClass{ global ...
0
votes
1answer
31 views

Can someone tell me what is the meaning for below code snippet

Can someone explain to me what is happening with the below code snippet //Creating New Contact Record public void createNewContact() { wrapperList = createNewContact(wrapperList); } ...
1
vote
1answer
40 views

Test coverage for wrapper class which takes user input

In wrapper class, there is a boolean variable named isSelected which I need to make true to increase coverage of a method. The constructor of the class always initializes the value to false. I am not ...
2
votes
2answers
630 views

How to adding dynamic rows/fields to wrapper class?

I have written the following WrapperClass, consisting different object records/rows/fields as members. How can I dynamically update this wrapper class object. In below code i have used only two fields ...
0
votes
1answer
108 views

Checkbox selection uisng Wrapper is not passed to controller

This might have been posted several times but i'm unable to workaround this issue using apex & I also looked at all the existing questions similar to this. I have a list of Opps with checkboxes in ...
0
votes
1answer
47 views

Retrieving values from an inner class with dot notation

I have a JSON payload I'm processing from a REST API web service in Salesforce. I converted the JSON to a DTO object in APEX with the following: WorkOrderDTO Class global class WorkOrderDTO extends ...
0
votes
0answers
59 views

Structure of visualforce page using standard controller, extension and wrapper of data?

I am creating a component to add to a contact record that shows aggregated note data from two different sources. Page <apex:page id="AggergatedNotes" standardController="Contact" ...

1
2 3 4 5
7