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
1 answer
10 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,257
0 votes
0 answers
35 views

LWC getting undefined while using a Wrapper class to send only one record back from Apex

New to LWC. Tried all tricks looking at various threads but in vain. Please help. Apex class: - public without sharing class getCarrierPerformance { @AuraEnabled(cacheable=true) public static ...
0 votes
0 answers
26 views

Order of JSON Response for HTTPGET API

I have created Apex class to get bulk records from salesforce, but in Postman JSON Response order is changing, it is fetching alphabetical order. Apex class: @RestResource(urlMapping='/testurl/*') ...
-3 votes
1 answer
32 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
48 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 ...
  • 41
0 votes
1 answer
44 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) ...
  • 31
0 votes
0 answers
27 views

LWC: Save Functionality - How to update quantity on OLI if quantity value is updated through wrapper in lightning data table

Please find the code: HTML code: <template> <div> <lightning-card title=""> <div class="slds-p-around_xx-small"> <...
  • 31
0 votes
1 answer
76 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 { @...
  • 31
0 votes
1 answer
57 views

How can I update wrapperlist item

How can I update the wrapperlist item with the value of the second for loop? Always the wrapper adds the whole information (see my screenshot). Also I don't know how can I display the result at a ...
  • 27
0 votes
1 answer
15 views

Wrapper resultlist will not appear at my visualforce page

The resultlist of my wrapper will not appear at my visualforce page. The debug log shows me that something is in the resultlist, but nothing at my visualforce page. public class Camp_Letter { ...
  • 27
0 votes
2 answers
120 views

How to loop through in a wrapper class and print data in an another class

Wrapper class: public class Check_Request_Response_WS { public root root{get;set;} public class root{ public list<ACC_DOCUMENT03> ACC_DOCUMENT03{get;set;} public ...
0 votes
1 answer
38 views

How can I use other map identifier

For my campaign I need some additional information form a custom object PC_List__c. In this list I have more information (e.g. salesrep) about the postcode. I use a wrapper to collect the data of the ...
  • 27
0 votes
1 answer
59 views

Enum property is not visible in Flow

I have flow which is using Enum property and trying to access in the flow, but for some reason it not showing up, Enum Property Wrapper class Not showing up in Flow Any clue will be highly ...
  • 138
0 votes
1 answer
21 views

Can't add custom class to list

I have custom Wrapper class public without sharing class OppProdWrapper { public String Name; public Decimal UnitPrice; public Decimal TotalPrice; public OppProdWrapper(String ...
  • 29
0 votes
1 answer
52 views

How to populate records into specific wrapper structure?

There is an external system, from which I need to pull (via REST request) information about, let's say, brands and their categories. After the request, I need to collect the data in such structure: ...
2 votes
1 answer
140 views

Deserialize JSON to custom class

I have a JSON response coming from an HTTP callout that contains an array of columns and an array of array of records where those records have a value that needs to map to the column. Example data ...
  • 123
0 votes
1 answer
135 views

How to get Test Coverage on a Simple Wrapper Class

I'm trying to get a test class to cover a few wrapper classes I've created in Apex, but for some reason one of the wrapper classes doesn't gain coverage (0%) like the other one does (70%). I read in a ...
-4 votes
1 answer
544 views

How to and retrieve , display the key and value of map<string,id> in LWC which is returning from an apex wrapper class

Apex method @AuraEnabled(cacheable = true) public static List<WrapperClass> pageResourcesFalse(String cardName){ List<id> documentId = new List<id>(); List<string> ...
0 votes
0 answers
69 views

VFP group header from map

Here is the inner/wrapper class and the VFP. I am currently getting this display where the Product_Group__c repeats for every code. I want to display the group once and repeat all codes and values ...
  • 41
1 vote
2 answers
257 views

How to serialize an object and string variable?

objectApiName = 'Account' newFieldConfigJson={"Type":"Text","Value":"Name","Order":"8"} I have these two values that I need to ...
  • 97
0 votes
0 answers
13 views

test class for apex class which has wrapper class [duplicate]

public class MyOrderListController { public List<WrapperClass> WrapperList {get; set;} public class WrapperClass{ @AuraEnabled public string PName{get; set;} @...
0 votes
1 answer
124 views

How to access the values from while returning the Object

public class TestWrapperClass { public class InnerWrapper{ private String name; private String location; public String getName() { return this.name; } ...
  • 1
0 votes
2 answers
135 views

LWC record display issue

I have two objects in my org question and answer which has a lookup relationship between them. I wanted to create a LWC component which displays one question with multiple answers but I am unable to ...
  • 97
1 vote
1 answer
1k views

Make onclick row in table LWC

Hi guys ^^ I am new in programming and Salesforce. I have little problem I wrote an apex class and now I want to make a custom tabele (that can't be a datatable) because in feature I will write a ...
  • 23
0 votes
0 answers
1k views

Onclick row in Datatable LWC

Hi guys :) I am new in programming and salesforce. I want to get to the apex and take a name of click company can you tell me what schould I wite in field message = 'NAME OF CLICK COMPANY';. When i am ...
  • 23
0 votes
2 answers
408 views

Wrapper and custom object in list

How to show this elements in html. I am new in salesforce and programming public with sharing class StockMarketSharesWrapper { @AuraEnabled(cacheable=true) public static List<Wrapper> ...
  • 23
0 votes
0 answers
101 views

JSON.deserialize returns null after deserialize

I've created controller to my Aura Component and it works. Controller public with sharing class B2B_RegisterFormController { @AuraEnabled public static void createLead(String lead, ...
  • 1
2 votes
1 answer
388 views

Visualforce Error : Map key true not found in map

Visualforce Page <apex:page docType="html-5.0" showHeader="false" controller="TaskRayController"> <apex:form > <html> <head&...
0 votes
1 answer
60 views

Accessing @api variable wrapper fields

I am new to LWC and I have created the following wrapper: public class myWrapper{ @AuraEnabled public Object1__c object1 {get; set;} @AuraEnabled public Object2__c object2 {get; set;} } I ...
  • 171
0 votes
1 answer
943 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
89 views

populate values in a wrapper class variable which is a list<wrapperclass>

responseSize = ParsedResponse.results.size(); if(tResults.keySet().size()>0){ for(Results re : ParsedResponse.results){ customObj tLocs = new ...
0 votes
1 answer
830 views

How to use Wrapper Class in constructor and call it in Queueable?

My Queueable Apex class worked fine before but after discovering Apex PMD ruleset, found that using >4 parameters in any method or constructor is not best practice. I tried searching up answers ...
  • 1,095
1 vote
1 answer
316 views

Problem passing a wrapper class from LWC to Apex

I am having trouble passing an apex wrapper class from LWC into APEX. Apex @AuraEnabled public static void myMethod(SomeData theData) { system.debug('theData is ' + theData); } public class ...
  • 4,531
1 vote
1 answer
476 views

Two arrays from seperate objects, one common Id. How to merge them into a wrapper class

So for this is what i have and i have zero clue on how to continue. What i do know is the Product2 Id is what links to the arrays together, to end up displaying like so....and i have no idea exactly ...
  • 494
0 votes
0 answers
25 views

Account with Event tagging of Yes or No in SOQL

My objective for this query is to show all of his/her accounts with tag of With Call Event (Yes & No). Meaning, Fields = "Branch", "With Call Event?" I tried below class but ...
1 vote
1 answer
300 views

Unable to send Wrapper class as a return type in @invocableMethod

We created a wrapper class and calling from SS_NBA_APIResponse class. Here i am getting an error that i can't send wrapper class as a return type. will you please help me how to send the wrapper data ...
  • 35
0 votes
1 answer
1k 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&...
  • 431
1 vote
1 answer
421 views

How do we implement a custom put() method for a wrapper class in APEX?

I'm looking to create a generic wrapper APEX class with few property fields (string type for now). Here is what my class would look like: public class wCustomWrapper { public String customProp1; ...
  • 5,686
0 votes
1 answer
84 views

Testclass for wrapper class implements Comparable and contentdocumentlink

I don't know how can I test my contentdocumentlink, in the log I got the information EXCEPTION_THROWN [18]|System.QueryException: Implementation restriction: ContentDocumentLink requires a filter by ...
  • 431
0 votes
1 answer
43 views

List does not return my manual field and how can I sort the list

I want to create a list of tasks, events, files and notes, so the sales man have just one list for all activities. The list works, but I still have a few questions. I add to each list a manual field ...
  • 431
0 votes
2 answers
375 views

How can I add different objects in one List?

I would like one list of different objects (Task, Event, Notes). In mycode I create a wrapper class for the different objects and I display the list on a visual force, but there are still 3 lists just ...
  • 431
0 votes
1 answer
458 views

How to write Wrapper Class and using Visualforce page to display multiple objects data. Best Practises [closed]

I want to display 2 objects like Job Deal object(Job Deal Code, Job) and Recruiter Objects records fields in a single table. How to write VF page using wrapper class
  • 1
2 votes
1 answer
2k 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
223 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
3 answers
175 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 ...
  • 325
1 vote
1 answer
795 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: ...
  • 313
0 votes
2 answers
84 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
2 answers
296 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 ...
  • 21
0 votes
1 answer
434 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
0 answers
74 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 ...

1
2 3 4 5
9