Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
42 views

Error: Too many DML rows: 10001

I have a question here, every time I run my code I first delete everything that is in the object, and then inserted a new list, when I try to do this simultaneously with the error ERROR System....
0
votes
2answers
15 views

APEX: Can't add instances of a custom class as elements of a list within a complex class

When I try to initialize an instance of the daisychain class below, using the makeDaisyChain method, I get a "System.NullPointerException: Attempt to de-reference a null object" error. ...
0
votes
1answer
24 views

Data Duplication [on hold]

I have a List in which I am adding registry, but I noticed that the registry comes duplicated, for that I used a set, but the set only returns me a single registry instead of a List, can someone help ...
-1
votes
0answers
16 views

Sort custom list according to the field [duplicate]

I have custom list in my controller which returns the values as below. (DealAttachment:[attType=Business Case Financial Model, bForContractMgmt=false, createdBy=ABSI, deleteA=true, editA=true, id=...
-1
votes
2answers
52 views

How to Divide a list which has set of duplicate values in it in apex

for(AggregateResult hier4: hierarchy) { fld4.add((String)hier4.get(Field1)); fld5.add((String)hier4.get(Field2)); fld6.add((String)hier4.get(Field3)); string Soqlstr3=' Select Name '...
0
votes
1answer
33 views

APEX Would like to validate my approach [closed]

I have written the following REST callout to update Club & Players custom object. Based on the API ID club information is fetched and updated, same for players as well. For players I need to check ...
1
vote
1answer
28 views

Removing ALL Duplicates on a List

I'm facing a Requirement Specs that can be simplified to this scenario. Simply put, the specs say to remove all duplicates from a list. This means not to leave one duplicate record from the list but ...
0
votes
0answers
21 views

Add rows on button click without loosing input values from prev row

I'm trying to make a table with add row functionality. The process is next: User works with one row, put data in input fields, and then add another row. The first row must contain data that user ...
0
votes
0answers
18 views

Save input values in to a wrapper list

I want to set the input values from my table to a wrapper list. Because, when I add new row my table is rerendered, and all input values befor are missed. Here are my code example: My Class: public ...
0
votes
2answers
36 views

how to add a List<List<String>> on a statement

Hello there I just want to put same 3 statement on a List> row List> [0] Statement 1 on a first row / List> [1] Statement 2 on a second row / List> [2] Statement 3 on a second row / To This same ...
1
vote
1answer
50 views

Is there a way a more efficient way to write the IF statement

Is the there a more efficient way to write the below IF statement so I only need 2 lines of code or can this be solved with a ternary operator ? if(postIds.size()>0) { PostProperty(...
0
votes
0answers
18 views

Visual Force: Pass javascript array from page component to Apex Controller

Hi I have a page component that checks all boxes in my table. There are also 2 arrays that will contain all the checkbox values and their checked status. How do I pass these arrays from my page ...
-3
votes
1answer
23 views

How to compare list custom setting records with other list of lead?

How to compare list custom setting records with other list of lead? //this list store the list of lead records List<Lead> leaddetails=new List<Lead> leaddetails(); //This custom setting ...
0
votes
3answers
30 views

apex:param get just last element. How to fix that?

I create delete-button to remove records from my list. First I choose records and add them to this list. Then I can delete some records, but it removes just last one. How to delete only selected ...
0
votes
2answers
32 views

Add second element of map (multiple same ID)

I wanted to know how to get the second element of my oppTeamMemberWrapper map knowing that its ID exists in several times in the wrapper map (the ID being the ID of the parent opportunity)
0
votes
1answer
18 views

How to test catch-part of the method? [duplicate]

I tried to put null rows and do many another things. I can't test this catch. It writes System.QueryException: List has no rows for assignment to SObject. public List<MyObject__c> getList(){ ...
0
votes
2answers
19 views

Error Method does not exist or incorrect signature

Getting the following error at line number 7. Method does not exist or incorrect signature: void add(Auto_Risk_Fill__c) from the type Map List<Auto_Risk_Fill__c> autoValues = new List<...
0
votes
1answer
27 views

updating related list

List<Opportunity> op = [ SELECT Id,AccountId, External_Id__c, StageName, Sales_Office__c, Held_or_Purchased_Model_Lookup__c, Subdivision__c, Lot__c, Hold_Expiry_Date__c,...
0
votes
2answers
20 views

Apex output only showing id how to show all data in list?

I am trying to display data that is being return by an API. On my system.debug I can see the data is there but on displaying on the page it only shows an array of the ids of the list object. This is ...
0
votes
1answer
34 views

How to use a few conditions for the same SOQL values?

I have a few conditions for the same fields of record. But I get the result only from last condition. How can I use them all? public List<Item__c> serch(){ String[] filters = new String[0]; ...
0
votes
1answer
11 views

Record ID not returning from list

I recently posted a question regarding preventing a null list exception (Link), which was answered but doesn't seem to return a result. Using the suggested solution, I have updated my controller, ...
0
votes
1answer
20 views

Create new filtered mobile contact list with automation

I've currently got an import automation which imports files dropped in an SFTP location. It adds them to a mobile list I have called SMS_Master. It works fine. Our marketing team then has to filter ...
0
votes
2answers
47 views

Apex - break list into multiple small lists before processing

I have a list of 15,000 records. I can maintain the count in a flag. Integer Counter = 15000; I want to break my main list into 3 small lists. Each list should contain 5,000 records. First list ...
0
votes
1answer
15 views

Illegal assignment from List<or_guestsJSON> to or_guestsJSON

I an trying to write a testclass for a JSON object but het the error: Illegal assignment from List to or_guestsJSON. How do I annotate the list in my testclass? Class public class or_guestsJSON ...
1
vote
1answer
27 views

How to set the variables of invocable method in unit test

I have an invocable method with varables. I am stuck how to set these in unittest Class public class or_service { public class invoceVars{ @InvocableVariable public id ...
1
vote
1answer
45 views

How can we add a new action (like Edit & Delete) for each record on the standard list page (Salesforce Classic)

How can we add a new action (like Edit & Delete) for each record on the standard list page (Salesforce Classic)?
0
votes
1answer
25 views

Sum up values(currency) from the list

Decimal totalReceived = 0.00; List<Money_Received__c> moneyReceived = [Select Amount_Received__c,Reservation__r.Total_Recieved__c from Money_Received__c where Id =: reservationId]; for(...
0
votes
1answer
55 views

Need Help with a Map

I need to create a map between a custom object and a List, my code right now is this: Map<Invoice_Header__c, Contact> headersToContact = new Map<Invoice_Header__c, Contact>(); List<...
0
votes
2answers
27 views

how to get a value after from result callout

I have the following where the result format of the callout is the following: [ { "uid": "72852a55-5be3-496c-904c-fc3fd261f0a4", "name": "Responseev Agency" }, { "uid": "66852a55-...
1
vote
1answer
63 views

Set<sobject> doesn't maintain uniqueness although I am fetching Id field

I am trying to upsert a list of records and I may get duplicates so what I did In loop I am adding records to a set then that set into the list for DML. Now problem is coming when I add a record in ...
0
votes
2answers
40 views

How to return null for list if we have too many records?

How to return an error msg, if boxes are more than 1000 and we can't return this list (return null + msg)? We need to do that with if or with try catch? Or we can try both variants? @HttpGet global ...
0
votes
1answer
29 views

Callout error Invalid conversion from runtime type List<ANY> to Map<String,ANY>

I just followed a trailhead on callouts and I am trying to get some values from an endpoint. My debug shows me my status is ok but I get an error on line 17: Callout error Invalid conversion from ...
0
votes
1answer
37 views

Update list from static method

I have a static method and it has this annotation @RemoteAction so it can be called from java script, I query a list in this method and I want to change a field value and update the list, this doesn't ...
0
votes
1answer
29 views

Invalid Bind expression type of <sobject> for id field SObject Account

I'm getting this error "Invalid Bind expression type of Class_Detail__c for id field SObject Account" Class_Detail__c.Student__c is a Master-Detail relationship field to Account. Basically I want to ...
2
votes
2answers
44 views

Lightning component attributes: Difference between Array and List

According to this document, the type type[] is "An array of items of a defined type" and the type List is "An ordered collection of items". I've tested the output of both structures (with integer ...
0
votes
2answers
18 views

Is there a list of every fields of every SF standard object?

Is there a list of every fields of every SF standard object ? I know how to have each field of an object in different ways.. I'm sure it would be possible using code, but it's for a collegue of mine,...
3
votes
1answer
22 views

apex - Internal server error when getting Element of a List of Maps

I am passing a List of Maps to my controller from the client-side javascript, and when trying to access an element of this list, an internal error is thrown. Here is an example of the problem : ...
6
votes
2answers
333 views

What is the difference between using the LIMIT clause and using a fixed index to retrieve data from a query?

This code recover the exact same account, I thought there could be differences with the way it ask the database ... Seems not to be the way it works, So an idea ? public static void ...
1
vote
1answer
37 views

How to put a list in the parameter for class and use its variables?

I have a JSON and I need to pass the data to a list, then use it as my class parameter. I've managed to pass JSON to a List, but when I put it in the class, it throws the following error: "global ...
0
votes
2answers
32 views

Add list in another list (building hierarchy tree)

I'm new to Apex (actually in programming in general) and am trying to build a hierarchy tree with 4 objects: Account, Carteira__c, Produtos_das_carteiras__r and AtivosFundo__c One Account can have N ...
0
votes
1answer
16 views

How to get api names and their value from list

Can anyone please help me with following issue I am having a list of opportunity contains 3 fields value for opportunity. List<opportunity> listopp = new List<opportunity>( ); listopp....
1
vote
2answers
25 views

Unexpected Token ERROR?

Any thoughts on why the errors? New to apex . Gentle with replies
0
votes
0answers
17 views

Show Error Message on Salesforce Standard List Page

Is it possible to show error message on Standard List Page? We have the functionality of export selected records, so if anyone hasn't selected records, can we show an error message? We are ...
4
votes
1answer
198 views

How to efficiently combine 2 Lists<Contact> if the same Contact is in both

I have 2 lists of Contacts, which may both contain the same Contact(s) or they may not. I have a method that combines the lists, meaning if a Contact is in both lists it will take the Contact's ...
0
votes
3answers
35 views

Filter duplicates from List Query

I am trying to filter the duplicate based on a custom field. Its working fine but it is filtering only one duplicate. if there are 3 records, its showing 2 records. The below is my code. List < ...
2
votes
0answers
16 views

Exit customer from welcome Journey - After click/subscribe

I am trying to launch a welcome series with the intent to get the subscriber to fill out their profile. I am using Journey builder to do it. I want to exit the Jounrey when the subscriber visits the ...
0
votes
2answers
147 views

Understanding All Subscriber behaviour in Business Units

Setup In our SFMC instance we have a parent BU and two child BU's mapped to it. I also have data extensions within the child BU's that contain Contact records from our integrated salesforce CRM ...
-2
votes
1answer
80 views

How to bind list of string in dynamic SOQL

List<String> cityList = Label.cityNames.split(','); String SOQL = 'Select id, name from Account where city IN:cityList' Databse.executeQuery(SOQL); Could you please correct the above ...
0
votes
1answer
82 views

Unordered List with no bullets not working with email template

I have a Visualforce Component that has a un-ordered list. I want that list to have no style other then the indentation. Usually with HTML you would just specify the ul css to be list-style:none or ...
0
votes
1answer
21 views

Conversion of a list to map with key as Account and map as account's corresponding contacts from a list of accounts

I have a list accountList which contains corresponding contacts aswell. Now I am trying to make a map from that list with key as single account and corresponding associated contacts as value. public ...