Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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

SOQL - Best practise : what method choosing while retrieving datas?

There are multiple ways of let's say instanciate a list of contacts using SOQL ; My question is : is there a difference between each other, and is there a best practise ? Examples String name = '%a%'...
0
votes
1answer
59 views

Display Relationships Between Lists on Visualforce Page

I have a list of strings. I am using these strings to populate three other object lists by querying for this string. For every iteration I am adding the lists populated to a List of lists. Ex: ...
0
votes
2answers
18 views

Unable to access versionData from test class

I am facing an issue but I don't know what I'm doing wrong. I'm writing a test class for a code which has this 2 lines: public static Blob getPkpass(){ // more code here... List<...
8
votes
5answers
29k views

(Lightning) How do I get the selected value from a Select dropdown list & send it to a method?

I'm trying to implement a single option select dropdown list for my component, and I've gotten as far as displaying the data members and the correct values for them. However, I can't find any example ...
0
votes
1answer
17 views

Add event listener for window resize in lightning web component

I want to ad an eventListener for window resize inside my custom lightning web component but I don't know how to do it Maybe something like this? constructor(){ window.addEventListener('resize', ...
6
votes
3answers
7k views

How can I add a new value to a picklist using APEX?

I have queries pulling all of the information correctly but what I can't seem to find was a way to add new options to a picklist using APEX. I currently have Package__c.Products__c.add(new Schema....
1
vote
1answer
74 views

Converting list into Integer

I have 2 string fields in database one is a name and the other is semicolon-separated values, I want to put the name and its summed up values in a map to use it later in the code. I can split the ...
0
votes
1answer
29 views

Marketing Cloud: Using Publications Lists to Update Salesforce Contact

I am leveraging Publication Lists in Marketing Cloud to manage unsubs from unique Business Units so that a contact can choose to unsubscribe from one business unit but not all. I also need this to be ...
1
vote
1answer
707 views

Array or List of Big Objects as parameter for AuraEnabled controller

Does Salesforce support passing an array or list of big objects as a parameter for an AuraEnabled controller method? In other words can I pass from a lightning component javascript controller an array ...
-1
votes
1answer
64 views

How to avoid duplicates in Map and make the comparison correct?

I have a code to compare then values from list and from map. But I'm getting duplicates in my map and only one map value in the loop later. How can I fix it? List<Tool__c> tools = [SELECT Id, ...
0
votes
1answer
39 views

Duplicate id in list: broken script

I have a script: List<Apartment__c> apartmentsToUpd = new List<Apartment__c>(); List<House__c> houses = [SELECT Id, Tenants__c, EntryDate__c, DepartureDate__c, Opportunity__c FROM ...
2
votes
0answers
40 views

“Automatically Refresh Upon Sending” list function doesn't work

In Salesforce Marketing Cloud, the button "automatically refresh upon sending" present in every contact list doesn't stay on after clicking on "Change" and setting it to "On". After the page is ...
0
votes
2answers
18 views

Apex: Duplicates in list when adding set to empty list

I came across a weird behaviour of which I don't know why it happens. Maybe you guys can help me: Setup: I have a list of records, over which I iterate (list name: fieldAutomations). Each iteration ...
11
votes
4answers
6k views

How to detect first or last iteration of apex:repeat

I currently have some VisualForce which uses an <apex:repeat/> element and inserts commas in between the items like so: <apex:variable var="idx" value="{!0}"/> <apex:repeat value="{!...
1
vote
1answer
34 views

Help with “Duplicate id in List”

I've recently started at a new company with a completely different instance. Recently I've noticed a growing amount of errors looking like CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: CaptureCard_Trigger:...
0
votes
1answer
602 views

Problem with passing List of objects to apex controller

I have a problem that i've been trying to work around for a while now. Basically i have a list of objects (some have id's some don't, the ones that don't have them will be inserted instead of being ...
-1
votes
1answer
35 views

calculate the total of a variable based on another variable in JS controller lightning

finalMap=[{"key":"OTC","subprocessName":"CXO","weightage":50}, {"key":"OTC","subprocessName":"Order Management","weightage":50}, {"key":"RTR","subprocessName":"Fixed Asset Accounting","weightage":20}, ...
1
vote
2answers
1k views

List sorting by custom field

I dont know how to sort a list of SObject Case. I have a List<Case> newCases which i iterate over in for cycle, where i save Cases to my new List<Case> casesList. for (Case newCase : ...
0
votes
1answer
706 views

How to cover a getter/setter list (populated via query) in a unit test?

TL ; DR : I'm unable to fill a getter/setter list (that is filled via SOQL query) during testing. When unit testing a controller class, a certain {get;set;} list is not getting populated (it is null)...
3
votes
2answers
379 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
1answer
33 views

For loop conditional statement for if a List<Contact> contains an element

I have some code like this. While the conditionals I have are working fine what I cannot check for is if Contact lCon is NOT contained in the sfdcList. I have been trying to find a way to set up a Set ...
0
votes
1answer
35 views

Sorting a List of different object Lists by datetime

I have a List<ListWrapper> comprised of List<Knowledge__kav> and List<Community_Event__c>. I would like to sort List<ListWrapper> by date but the two inner lists have different ...
0
votes
1answer
37 views

Iterating Through a Map<Id, List<Contact>>

This is a concept I am having a bit of trouble understanding. In this particular case I have debugged each piece within it and I can get the values I expect, But I am not able to iterate through them ...
0
votes
1answer
36 views

For loop to check if a list contains a string

I have a picklist on a visualforce page and I'm trying to filter by namespace prefix to display objects belonging to a package as well as the account and contact objects. I have the for loop below ...
1
vote
2answers
337 views

SalesForce Marketing Cloud / Exact Target: Create Subscriber in List via SOAP, but not showing up in list

I am trying to create a subscriber using the SalesForce Marketing Cloud/Exact Target SOAP API. My subscriber is successfully being created, but they are not appearing in the specified list (only ...
0
votes
2answers
64 views

How do I delete all subscribers list in child BU without affecting Parent BU in SFMC Enterprise 1.0

Can someone please help with the below issue. I have a scenario, we had a new child BU with zero subscribers in all subscribers list ( SFMC Enterprise 1.0 ) I have imported few contacts manually ...
0
votes
1answer
80 views

Database.Query does not return fields with null value

Hi i'm executing this query using Database.Query(query) Where query is SELECT field1__c, field2__c, field3__c FROM Object1__c On the current record, field3__c is NULL but when i query on the ...
0
votes
0answers
25 views

Populating a Map<Id,List<Contact>> for a comparison

What I am trying to do here is populate a list from a callout to Looker (BI Tool) then create a Map of Salesforce Account IDs to associated Contact Emails. To do this I created this method: public ...
0
votes
2answers
67 views

Illegal assignment from List<Set<Id>> to Set<Id>

I have two maps like below: Map<String,Set<Id>> emailMatchingContacts = new Map<String,Set<Id>>(); Map<String,Set<Id>> epostMatchingContacts = new Map<String,...
0
votes
1answer
31 views

Map Problem: Connecting multiple keys to a single list

I'm having an issue with the Map Collection. I'm trying to merge some duplicates. I have value that identifies the dupes Number__c and is appearing on multiple accounts that need to be merged. I'm ...
-2
votes
1answer
51 views

Convert string representation of array to Apex Array

*Edited to correct JSON string I have a string which looks like: "[[[1,2],[3,4],[5,6]]]" I need to convert it to Apex array like: [[[1,2],[3,4],[5,6]]] Using JavaScript I am able to simply pass ...
-2
votes
1answer
39 views

SObject row was retrieved via SOQL without querying the requested field: Webinar_Attendees__c.Voucher_Assign_Date__c

'm trying display parent fields and sub query fields in a table.But I'm unable to display sub query fields.Could anyone suggest an idea for me Page : ====== ...
2
votes
2answers
845 views

How to create more than one temporary record with lightning components

Dear fellow Salesforce experts, I am building a lightning component where I am using a form with fields in order to create multiple records. I am already able to create multiple opportunity records ...
0
votes
1answer
90 views

How does one populate a Lightning component combobox with a list of records (id/name)?

I have a Lightning component in which I want to display a list of records related to an Account. I currently have this (but it doesn't work): My Component display: <aura:if isTrue="{!not(empty(v....
2
votes
4answers
13k views

How can I get all elements from a list into a comma separated string?

I have populated a list with a class. Here is the query which is filling the list of Customers: List<Customers> customers = [Select Id, LegacyCustomerNo FROM Customer__c WHERE state__c = 'PA']...
0
votes
3answers
475 views

Unable to remove duplicates from list

Set<Wall_Panel_Type__c> myset = new Set<Wall_Panel_Type__c>(); List<Wall_Panel_Type__c> result = new List<Wall_Panel_Type__c>(); for (Wall_Panel_Type__c s : WallPostConfig) { ...
0
votes
1answer
413 views

How can you associate multiple standard list controller with a visualforce page

Good afternoon, We have a visualforce page that allows us to add multiple contacts at once from a account view. When we add these I would like to be able to associate these contacts with a campaign ...
1
vote
1answer
355 views

StandardSet Controller Pagination is not working with SelectOption

I know this question might have been asked many times here, and I have worked on StandardSetController but I have not faced any issues, until now. My issue: the next, previous, first, last ...
1
vote
3answers
4k views

Bulk Delete from All Subscribers List

I have 55,000 records I need to delete from the All Subscribers List. It seems like the only obvious way to do this is by selecting all and deleting page by page. I will appreciate pointers on a more ...
0
votes
1answer
31 views

Apex add list elements inside json without ()

List<List<String>> listaCot = new List<List<String>>(); detalleCot = '{"Cdocu":"31","Ndocu":"","Codi":"'+variable+'"}'; listaCot.add(new List<String>{detalleCot});...
0
votes
0answers
54 views

Remove parentheses from list in apex

I have this list. when i print it: System.debug(listaCot); //it shows this ({"Cdocu":"31","Ndocu":"","Item":2,"Codi":"0301-011626","Codf":"45TEL080075C009"}), ({"Cdocu":"31","Ndocu":"","Item":2,"...
0
votes
0answers
24 views

Error when storing SOSL Result into other list “Final Exception : Collection Is Ready Only”

I have written a SOSL query to search on a Custom Object and a Standard Object. When I am getting the results from it, then I am trying to store the value of fields into a set, to do a SOQL query ...
0
votes
2answers
31 views

apex add list to list

I have this code: String cantidad; String total; List<List<String>> pList = new List<List<String>>(); List<String> lstStr = new List<String>(); List<...
0
votes
1answer
722 views

SFMC user not added to All Subscriber List

my expecttaion was once i sended an email to a new subscriber he gets automatically added to the all Subscriber list. Emails are received. I now sended emails to new subscriber with Subscriber KEy ...
11
votes
3answers
2k views

Lightning: dynamic index in aura attribute with type List

related post I am having the same issue. Trying to access array with dynamic index arrayList[index] (index from aura:iteration), but Salesforce doesn't support that. Does anyone know how to do this?...
0
votes
0answers
30 views

What is the best way to populate a map from a list conditionally?

I would like to know if there's a better way to populate a map from a list where conditions apply as to whether the list item is to be added to the map or not. For eg I have a list of objects ...
3
votes
0answers
38 views

Case standard list controller won't show any records on visualforce page

I am new to Visualforce, and for the life of me I can't get a case standard list controller to show cases. It works for Accounts and Contacts, just not cases. Here is the code: <apex:page ...
0
votes
1answer
29 views

Method updates all records inside <list> - should update only 1

I have implemented the following visualforce page on the lead layout: Here is the code: .hmk_top5table{ color:black; width:99%; font-family:Arial, Helvetica, sans-...
1
vote
1answer
37 views

Error: Compile Error: Unexpected token 'List' (SOSL query)

In "Jeet Singh" visualforce tutorial, there is a part talking about search operation, but I get the error when trying to save the code below, I copied exactly the same. any idea why? public class c6{ ...
1
vote
1answer
24 views

Can't retrieve a different attribute than status from a list through SSJS

I am trying to receive a specific subscriber from a list by using the email address as an identifier. After I have this subscriber I want to print out it's subscription status. So far I am still stuck ...