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
-2
votes
0answers
13 views

How to cover my wrapper Class [duplicate]

I need your help to cover my wrapper class in the test class : **Wrapper class :** @JsonAccess(serializable='always') public with sharing class HelicoRequestsWrapper { public ...
0
votes
1answer
28 views

String to DateTime Conversion when updating on the field directly in Apex

for (Lead__c l: leads) { l.Last_updated__c = String.ValueOf(leadResponce.leadData.lastUpdated); } how can I converted the value coming form the JSON from the wrappers while updating a field ...
1
vote
3answers
55 views

append wrapper class values if id are same

I have a List of type wrapper class having two variables let's say col1 and col2. I want to append all col2 values if their col1 is the same and store it as col 1 and col 2 in a new variable. Here is ...
1
vote
1answer
33 views

Sending list of objects from LWC works with wrappers but fails with list of maps

I have a LWC that sends the following list to apex 0: Agent_Mobile_number: "999999999999" Call_Date: "2021-05-08" Call_Remarks: "LOL" __proto__: Object 1: ...
0
votes
2answers
51 views

Error “ List has no rows for assignment to SObject”

I am doing a wrapper class binding account and its related contact and opp record. For starters, there is only one Account with the name 'Account1'. 'Account1' only has 1 Contact and 1 Opportunity. My ...
0
votes
2answers
48 views

Trigger with Wrapper class

I have created a wrapper class in which I have Name and Rating variables which are string type. 1)I have pulled out Account with the name and Rating and wrapped it in a wrapper class and stored the ...
0
votes
1answer
42 views

Lightning Web Component Accessing Attributes From Wrapper Class Without Explicitly Setting individual Attributes or Using Iteration

I've created a wrapper class and have denoted each attribute with @AuraEnabled public Class RecipientWrapper { @AuraEnabled public String FirstName; @AuraEnabled public String LastName;...
0
votes
0answers
23 views

Add createddate and file size to wrapper class of contentdocumentlink

I am working on a visualforce page that displays names of contentdocumentlinks, and as the page is currently, it shows 2 columns: numbers and names of the contentdocuments. I want to add a couple more ...
0
votes
0answers
15 views

How to pass value from one VF page to another and refresh page where value is sent(Both vf pages will be used as Components on Lightning record page)

I have to create 2 VF page (casecreate and KnowledgeArticles) Both components will be placed on Lighting Record page and these pages will be used as Components Case create page is created from where ...
0
votes
1answer
47 views

How to access a wrapper class properties from html

I have the following apex class where I am returning a wrapper class back the lightning web component and access the values of that wrapper object from javascript and html to carry out some processing....
1
vote
1answer
28 views

Not able to Set RecordId for Record in Apex Class

I am trying to create Account, Contact and User from Custom Aura Lightning Component but iam not able to set RecordId for the Record. Below is the Method that iam using for Record Creation. In the ...
2
votes
1answer
96 views

Is it possible to cast wrapper instance dynamically?

I wonder if it is possible to cast object parameter passed from LWC Component to specific instance of Wrapper class. In Example we have WrapperB that extends WrapperA and we want to cast data passed ...
0
votes
1answer
16 views

Lightning:Datable returns blank

I am using a wrapper class in generating the values for a lightning:datatable, however no value is being rendered on the table. Apex Class: public class wrapperObject{ @auraEnabled public ...
0
votes
1answer
35 views

Need help on Apex Test Class for Wrapper Class

Can someone help me with how to write a Test Class for the below Wrapper Class... public class OppRelatedSolutionsController { public List<WrapperClass> wrapList{get;set;} public ...
0
votes
0answers
39 views

TEST APEX - How to cover size() > 0 in WrapperClass [duplicate]

I'm trying to cover a condition that verify if my list isn't empty. But no matter what i'm trying it cover the SOQL query but doesn't cover the if statement as you can see below. The way i'm trying ...
0
votes
0answers
9 views

Wrappers Impact on Overall Code Coverage? [duplicate]

If a given wrapper doesn't have any method(even no get;set;) that class won't get listed under 'Overall Code Coverage' section in the developer console. Does this mean such Apex wrappers do not impact ...
0
votes
1answer
55 views

How to sort list of dates in apex and return the entire record? [duplicate]

I have a custom object called Insurance which has a Start Date field. I am planning to use bubble sort to sort the records based on the Start Date. This is what I have tried so far and got confused as ...
0
votes
1answer
27 views

Need help in creating multiple lists from one query in Apex Class

I am trying to achieve a list like this (conWrapper:[BankName=abcd, Branch=main, phone=123456789], conWrapper:[BankName=abcd, Branch=main, phone=987654321]) From below class, public without sharing ...
0
votes
0answers
16 views

Sort List by CreatedDate [duplicate]

I have a following wrapper class: public with sharing class HistoryRecordWrapper { Id CreatedById; Datetime CreatedDate; Object Field; Object NewValue; Object OldValue; public HistoryRecordWrapper(...
0
votes
1answer
39 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
58 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
41 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
1k 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
213 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
20 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
30 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
60 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
28 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
398 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
36 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
72 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 ...
0
votes
1answer
61 views

APEX - Initialize sub classes in a constructor

I am trying to find a solution to initialize a subclass in a constructor, but I have the following error message : Variable does not exit: Info public class Products { public String Name; ...
1
vote
1answer
33 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
246 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
1answer
108 views

Issue while saving the wrapper data through imperative way of LWC

I am trying to pass the listofWrapper-> (List) data to Apex method for DML operation. I am not able to figure out how to get Outer loop index ("Oppindex") for any change in the child ...
0
votes
0answers
52 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
23 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
113 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
278 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
265 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": &...
3
votes
1answer
272 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
74 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 ...
0
votes
1answer
21 views

we are trying to create a reports with all sobjects even though it has relationship or not

We are trying show reports data in a table similar to Salesforce we are unable to show data like Salesforce. please find below the screenshot for your reference.
1
vote
1answer
441 views

LWC JavaScript way to copy List [List A, List B] Values to a single List

I'm looking for a way to copy wrapper list of content values to a single list Example: LIST<wrapper> dataAandB= [LIST A,LIST B] => List A =[Object X :{Id,Name ... }] and List B =[Object Y :{...
1
vote
1answer
474 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
235 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
34 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 ...

1
2 3 4 5
8