Questions tagged [list]

A list is an ordered collection of elements that are distinguished by their indices. List elements can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.

Filter by
Sorted by
Tagged with
0 votes
1 answer
38 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: ...
user avatar
0 votes
0 answers
18 views

a method in contentversion trigger return "List index out of bounds: 0"

i am making a content release trigger with a method to update the mobile business app for my work. The objective of all this is to send the data stored by the SNOTES and store it in the backend of the ...
user avatar
  • 21
0 votes
1 answer
25 views

All Subscribers issues across Multiple BU's

I have a Master BU and 5 child BU's. When a subscriber signs up on the website they were added to child BU and a welcome Email is triggered, they were added to All subscribers in all child BU'S and ...
user avatar
0 votes
0 answers
22 views

How to compare metadata value with list of sobject values without using fields

I am trying to achieve the following functionality: I have created a metadata configuration that will hold the value and I have built a dynamic query where I will get all the fields added to the ...
user avatar
  • 143
0 votes
1 answer
44 views

Delete all the Subscriber from a Supression List

I'm trying to remove all subscribers from a suppression list, I have been able to get one in particular to be deleted, but I have not been able to do it for all of them. How could it be done? Thanks ...
user avatar
  • 5
0 votes
0 answers
26 views

Double OptIn list option inserts contact as "Active" automatically

Ive been trying to make a classic list with the Double OptIn function following these steps, and the part about sending the email works perfectly. But, each time a new contact is added to it through ...
user avatar
0 votes
1 answer
46 views

Delete all Subscriber from a Supression List

I'm trying to remove all subscribers from a suppression list, I have been able to get one in particular to be deleted, but I have not been able to do it for all of them. How could it be done? Thanks ...
user avatar
  • 5
-1 votes
0 answers
39 views

Get value from JSON deserializeUntyped List [duplicate]

Im receiving this JSON: {"key":1,"nombre":"Test 2","tipo":"Muestra","cantidad":"11","id":"l780000"} i convert ...
user avatar
-1 votes
1 answer
24 views

How to sum values from a List of Double [closed]

I'm in need of help figuring out how to add values present in a list of Double. For example: List<Double> doubleList = new List<Double>({1.5, 2.2, 3.4, 4.8}); How do I add 1.5 + 2.2 + 3.4 +...
user avatar
  • 1
1 vote
1 answer
22 views

Test Method Issue for removing duplicates from List

I have a requirement to remove the duplicate objects from a list at several places in my integration code and I have developed a method in the Util class to remove the duplicate objects from the list. ...
user avatar
0 votes
1 answer
28 views

LWC - Don't get the Data

With this code, I want to get the last stock value of my record respecting the condition and transfer the value in ‰ and take only the two digits after the decimal point. The problem I have is that I ...
user avatar
-3 votes
1 answer
41 views

How to add many values at once in Apex? [closed]

I have a list like that: List l = new List(); l.add('a'); l.add('b'); l.add('1'); l.add('2'); l.add('3'); How can I add all those values at once without using so many add methods? In Java we can do ...
user avatar
0 votes
2 answers
22 views

Getting list of Opportunity Id with apex. (getting an error)

I created a test class and i require to get list of Opportunity Ids, I got this- List<Id> oppsIds = [SELECT Id FROM Opportunity]; OpportunityIntegrationCalls.sendEmptyQuote(oppsIds); ...
user avatar
1 vote
0 answers
39 views

Size Limit on Sending data from Apex method to LWC JavaScript as return paramater

While sending the data to Apex , we have limit of around 3MB. But is there any size limit on sending the data from Apex method as return type to lwc JavaScript. Since 6MB will hit the heap size limit, ...
user avatar
  • 11
-2 votes
1 answer
49 views

Method does not exist or incorrect signature: void contains(String) from the type List<Lead>

I'm trying to find if there's a duplicate record Name in Lead object if I create new record, however I'm getting this error when using contains() method. What can I do to fix this? And why I'm getting ...
user avatar
0 votes
1 answer
28 views

How to manipulate date type list to not capture time

I'm trying to capture the smallest element of a list of type date, get the closest date in summary. Follow my code so far: public List<Quote> getOrcamentos(){ if(lstOrcamentos == null) {...
user avatar
  • 255
0 votes
1 answer
22 views

Help to send data from one list to another using temporary object type

can someone help me with this operation with lists? I have two lists, one is a custom object and the other is : public class OppNegocioTemp { public Double Demanda_Compra {get;set;} public ...
user avatar
  • 255
0 votes
1 answer
48 views

How to pass a list to another list?

can someone help me with a question, I have a list with data that I get from a custom object, and I want to pass this data to another list created within the class....showing the code makes it easier ...
user avatar
  • 255
-1 votes
2 answers
65 views

JSON Array String into List

Sorry for this noob question but I just want to ask: String stringJSON = '[{"action":"ASSIGN","value":"Router"},{"action":"DISABLE","...
user avatar
0 votes
0 answers
32 views

Finding the max of value of Map<id, sObject> based on custom field

I am trying to find the biggest record in the Map for each iteration. The sorting should be based on the custom field X. After finding the biggest record, I should increment one of its fields (Y field)...
user avatar
  • 35
1 vote
1 answer
46 views

Logic problem, it is possible? Add more quotelineitems if it has more than 1 on quantity

Hello Guys. My method does not work correctly. What it does is call another method inside a loop, the functionality is to take each quotelineitem from the quote until it finishes collecting all the ...
user avatar
-3 votes
1 answer
50 views

Apex remove duplicate related records from list [closed]

Before inserting a list of new tasks into Task object , I need to make sure only one task for each WhatID is inserted. Here's the sample structure. Task-1 and Task-2 have the same WhatID, then I ...
user avatar
  • 11
0 votes
1 answer
13 views

Modify string value in soql list and add back to list

I have a VFP which functions as a CSV download. In my controller I return a simple SOQL list from a custom Customer object. I need to modify the Name being returned to remove all commas and then add ...
user avatar
  • 29
0 votes
1 answer
33 views

Create list with two queries

i have this query: Set<Id> drIds = new Set<Id>(); List<custom_Object__c> dr = [SELECT id, name FROM custom_Object__c WHERE AcountId__c =: accountId]; for(custom_Object__c drl :dr) { ...
user avatar
0 votes
1 answer
38 views

common.apex.runtime.impl.ExecutionException: Invalid conversion from runtime type String to List<College__c>

VisualForce Page <apex:page controller="dynamicpicklistcontroller" sidebar="false" > <apex:form > <apex:pagemessages /> <apex:sectionHeader title="...
user avatar
3 votes
2 answers
144 views

What do I have to do in this case: List<Sobject> or Sobject?

I am beginner in Salesforce and I have to verify if the field Order.ShippingCountry is filled using the OrderId. I would like to reuse this method below to fetch the Order.ShippingCountry. But I was ...
user avatar
  • 79
-1 votes
1 answer
73 views

Converting CSV to an APEX List [closed]

I have a csv file downloaded with 1 column listing about 3000 names. What is the simplest way to grab all these names and store them in a List to be further manipulated in Apex? Thanks!
user avatar
0 votes
1 answer
37 views

Modify AggregateResult List value to take substring of it for displaying on vfp

**solved: I was able to return them as sObject instead of list since I know I will always receive a single value. I was then able to use right function to take my substring. Below is my controller I ...
user avatar
  • 29
0 votes
1 answer
18 views

Expand inner soql array and return regular list in controller for visualforce page

Here is my controller. I want to expand the array so that the fields are accessible in my vfp. When I try referencing any fields from the inner query in my vfp I receive "Error evaluating dynamic ...
user avatar
  • 29
-3 votes
1 answer
27 views

Illegal assignment from List<String> to List<Order> (4:21)",

Im having this issue which I dont understand. Any advice?
user avatar
-2 votes
1 answer
23 views

trying to set the value of field name but that field name is stored in some string

i am trying to set the value of field name but that field name is stored in some string, in Line 9, do any of you have any idea how can we achieve this?
user avatar
-3 votes
1 answer
70 views

SOQL nested query not working

I want to save the following query but it given me errors: Query: Set<Id> extUserIdSet = new Set<Id>(); List<Object1> obj1= [ SELECT Id, ExternalId, Name, Address, ( ...
user avatar
-1 votes
1 answer
33 views

Search items from list and get count [closed]

I have a list of accounts from SOQL as below: List<Account> accList = [Select ID, Name, MyField__c From Account where course__r.status = 'active']; I have added the values of MyField__c from ...
user avatar
  • 15
0 votes
1 answer
51 views

SOQL check if unique value exists and throw error message

I want to check if all the records have the same values for "Group__c" field and throw a message if the values are different. Example data: If all the records are of the same group(Group-A ...
user avatar
  • 15
1 vote
1 answer
19 views

Compare List of 2 Objects and output Matched Values

I a using the code below to compare lists of records from 2 different Objects - Resource__c and RateCardItem__c. There is no lookup field on the Resource__c to the RateCardItem. However the ...
user avatar
0 votes
2 answers
187 views

How to Type Cast Sobject List to custom object List in Apex to access custom object fields

Let's consider the below scenario: I have a scenario to type cast sObjectList into the List<customObject__c> so that I can access customObject fields and store it into the following: String ...
user avatar
  • 11
0 votes
1 answer
18 views

What does referring to a child relation of an object return?

Custom Object Maintenance_Request__c has master Detail relationship to Custom Object Vehicle__c (Child Relationship Name = Maintenance_Requests). In the Following code for(Vehicle__c veh : v){ ...
user avatar
-3 votes
1 answer
51 views

Populate a Map<String, customObject> when String is the userId and customObject is not related to User Object [closed]

I have a CustomObject and a User Object and both are not related to each other, however there is a field in both the object that stores same values. I have to use that field to compare and create map ...
user avatar
0 votes
0 answers
30 views

how can i choose one email from all email Map list?

I'm just starting with salesforce and need some help. I need to get one related email from Map email list. I manage to get all emails with this query, but don't know how to get one I needed. Any help ...
user avatar
  • 3
-2 votes
2 answers
50 views

Convert Contact List to upperCase in Aura [closed]

I've a below code to sort the contact list without case insencitive. Code: List<Contact> contacts = new List<Contact>(); { contacts = [Select id,Name from Contact where ...
user avatar
0 votes
1 answer
17 views

SFDX Package Version List command returns 431 Error

When I execute the command sfdx force:package:version:list I receive a message <h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre> I don't understand why ...
user avatar
  • 13.3k
0 votes
1 answer
399 views

Apex - Loop Through List and Set of IDs

I have a set of IDs and a soql to get list of accounts for those IDs: Set<ID> setOfIDs = new Set<ID>{//AccountIDs}; List<CustomObj> lstCustObjDetails = [Select ID, Name, Record__c,...
user avatar
  • 15
0 votes
0 answers
31 views

Apex List.add() always is null during test but works fine otherwise [duplicate]

Below code does not when I test via test class. I debug it I see the productPackges are all there but the IDs are not getting added to the Id list. Code works fine if I deploy and test but just test ...
user avatar
-1 votes
2 answers
783 views

Why I am getting error : System.SObjectException: SObject row was retrieved via SOQL without querying the requested field?

Covered Product is an object and Installed product is a lookup field on Covered product and Status is a picklist field on Installed product. When I am trying to run the below code in Execute Anonymous ...
user avatar
  • 1
2 votes
1 answer
1k views

apex : convert object to a list

I have an object with value (s1,s2,s3,s4) (this is the value i get during System.debug) now i want to convert this values to list of strings , i.e ['s1','s2','s3','s4']. how can i do that? i tried , ...
user avatar
1 vote
1 answer
27 views

Performing an update on record/s that appears in two lists. How to stop the update appearing in both lists (my own old and new lists)

I'm working on a class thats outside the normal trigger set up and used as part of an integration. I'm looking to have two list or maps, one that contains the records data pre update. The second ...
user avatar
0 votes
2 answers
125 views

Will acc.Contacts return list of all Contacts related to the Account?

Will acc.Contacts return all the related contacts to the Account? What does actually acc.Contacts means in this code? When I am doing System.debug() it returns (). What should be the output for this ...
user avatar
  • 101
-2 votes
1 answer
37 views

convert list with duplicate id to Map

I am working on an apex which is used to clear Hierarchy field values on User records when a user is deactivated. I am stuck at the last part of code. I have a List with same UserID but with different ...
user avatar
1 vote
1 answer
61 views

How to select other Welcome Email in Marketing Cloud?

I created a new list for subscribers and want to set up a welcome email but when I try to choose emails, there is one basic test email appears. How can I select email which I created earlier from &...
user avatar
0 votes
1 answer
32 views

I have 1 list and want to use 1 list and create a new list with the data

list<Contact> listOfContact = new List<Contact>(); for (Contact conObj : listCon) { if (String.isBlank(conObj.accountid)) {...
user avatar

1
2 3 4 5
17