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
1answer
112 views

Generate a list in customer journey

I'm wondering if exists a way to generate a list of subscribers at a certain point of the customer journey to retrieve customers arrived to that point and their individual engagement.
3
votes
1answer
214 views

Map behaviour populating with List

I've noticed some strange(?) behaviour with Lists and Maps. Below is a snippet of code: // Query for a List of Accounts List<Account> accountList = [SELECT Id, BillingStreet, BillingCity, ...
1
vote
2answers
430 views

loop through accounts and update

I am currently updating contact related records on accounts which updates my contacts correctly. When i try this for account I get the error: Method does not exist or incorrect signature: void ...
0
votes
1answer
60 views

Associate a record from 1 custom object in the related list of 2 custom object

I have two custom objects: x__c and y__c. I have multiple records in y__c object. This object is displaying as a related list on x__c object. I want to create a button which will take records from ...
1
vote
2answers
2k views

Delete failed. First exception on row 0 with id xxxxxxxxxx; first error: ENTITY_IS_DELETED, entity is deleted: []

I am trying to Upsert bulk records in Custom object using dataloder. I got error like: FATAL_ERROR|System.DmlException: Delete failed. First exception on row 0 with id xxxxxxxxxx; first error: ...
1
vote
1answer
48 views

List is returning no objects

I'm getting an odd error when trying to pull a value in a list. I know the error is due to no rows however it fires the exception on row 0 which is odd to me. Any help would be great. Here is the ...
0
votes
1answer
33 views

Old unchanged Test Method Fails during deployment of unrelated code

There are similar questions but they hold no answers and are not specific. Error Message / Test Failed during deployment of unrelated code: Test_Method_Test ThisTest System.ListException: List ...
1
vote
1answer
144 views

How can I update Child records from list of Parent Records in custom controller?

I have a custom controller with a list of parent records (opportunities) and a list of their child records (opportunitylineitems). I want to save both the parent fields and child fields with one ...
2
votes
1answer
246 views

All possible combinations of values in two lists [closed]

I have two lists, let's do: L1 = {A, B, C} L2 = {A1, C1, C2} List L2 contains duplicates of values in list L1. Each value in List L1 can have one duplicate in list L2 (as "A" and "A1" in the e.g.), ...
0
votes
1answer
386 views

How to get the row data in apex pageblocktable to update the list in apex class

Im planning to update each row using actionSupport event = "onchange". I'm trying to get the ID of the row but it is NULL. Or Is there any way It can be updated as a list without using the ...
0
votes
3answers
67 views

set to string conversion

Set<ID> objIDs = new Set<ID>(); //objIDs is used to store the user Id's i have two id in ObjIDs, for example: 0054E000001jEoUQAU, 0054E000001lC07QAE. How to query the email address ...
0
votes
1answer
43 views

Triggering an email from a new list entry in Marketing Cloud

Does anyone have any idea about a way to trigger an email when a subscriber is added to a list in Marketing Cloud? A 3rd party is sending us subscribers but their standard integration creates list ...
0
votes
1answer
33 views

ERROR: CustomerTrigger: execution of BeforeUpdatecaused by: System.ListException: Duplicate id in list:

I have written one trigger on before update. On customer object -before edit i need to save changes in Test_c object. trigger CustomerTrigger on Customer__c (before update){ list<test__c>...
0
votes
1answer
562 views

Sorting a keySet

I have a list that I created with a Wrapper Class and a Comparable/compareTo method. So it is sorted the way I would like it. From this list I created a Map with the key being the list's Created Date. ...
0
votes
2answers
87 views

Created a dynamic string and want to fetch list size on the basis of that string [duplicate]

I have an object that is having multiple child objects. I want to perform certain actions only if the current record has child records associated with it. For this I am checking the related list's ...
0
votes
1answer
97 views

Populating Account Name to Task from Account or Opportunity

I want to record the Account name to the Task so I can use it for things like email alerts. I have found code allowing me to add the account name from the Account when the WhatId is an Account. I want ...
2
votes
1answer
317 views

SFMC - Use Script to Retrieve List members for * status

I am attempting to use the subscribers.Retrieve function to retrieve members of a list. However, I am hitting a roadblock with the parameters. I'm looking at member status, but I can't seem to use a ...
0
votes
2answers
139 views

How to insert duplicate ids to list

In my logic I need to paste objects to list, and those objects will have same ids, but different other fields. Smth like this: List<Contact> retreivedContacts = getContacts(); List<Contact&...
0
votes
1answer
94 views

Marketing Cloud & Formstack Integration

Integrating a form from Formstack to find out that the integration can only populate a LIST within SFMC. Is there any way to personalize this list so that I can have the fields on the FormStack ...
0
votes
1answer
130 views

Add related list Id to List

I have a SOQL query which gives me the fields i expect: [Select (select Id,Name from signrequest__SignRequests__r) from Lead WHERE Lead.Id='00Q0Y000003iRelUAE'] But when i try to place the ids in a ...
0
votes
1answer
283 views

What's the easiest way I can sort the results of a list of events from a custom object?

I have a custom object called event and it houses the events for a non-profit I am working for. I am trying to find a way to get the events to be sorted alphabetically when the page is pulled up. I am ...
-1
votes
2answers
320 views

Combine 2 lists and output in a new list with indexes changed

I have a map as below: Map<Integer, List<String>> iMap = new Map<Integer, List<String>>{ 1 => new List<String>{'a','b','c'}, 2 => new List<String>{'d'...
0
votes
1answer
228 views

Default list views like all records or recently viewed having different columns depending on user's profile/group etc.?

Is it possible to configure default list views like recently views to have pre configured columns based on user type (profile, group) or the only option is to restrict view visibility by creating ...
7
votes
2answers
560 views

Lightning List Builder - Need Working Example

I am trying to build a lightning component that includes a list builder. The example supplied does not work out of the box as it uses the depreciated svg component. There is no mention of the list ...
0
votes
1answer
908 views

Filter Query Result in List and Put in Map

I have been working with ObjectPermissions Object. I need to show entire table on vf Page using SOQL Select **List Fields** From ObjectPermissions Order By Parent.Profile.name With the result i get ...
1
vote
1answer
402 views

JSON.deserializeUntyped problems with long list

I have this string s1 : {"iss":"backend","nbf":499071708,"iat":1499071708,"exp":2499071708,"Server":{"Version":"1.0","Identity":"backend"},"Data":{"ContentList":["AzEuMFveOpUnBpFTJ5yYdqdZxJs=","...
2
votes
3answers
212 views

How to Create a Read-Only Collection? [closed]

I want to create a collection (List or Set) which can behave like Trigger.New context. Means If we use the collection out side of it's class, we should not be able to add any element in this ...
0
votes
2answers
33 views

How do you create a list of items that don't contain ids from another list?

OK, I am trying to think of the best way of doing this, and all of the solutions seem over complicated... I'm missing something simple and I don't know what. Can someone please help me with a simple ...
0
votes
2answers
48 views

How can I notify a user that a record will have an error on save due to a validation rule?

Our business has a lot of customized validation criteria and it can change and be very complex. There is no easy way to use required fields for all users to prevent validation errors. I have created ...
2
votes
1answer
91 views

Put common values of two sets within one of them without using loop

This is a logic I am stuck with. I have two sets. One set has about 20k records(Set A). Another one has about 5 records(Set B). Set B is a subset of set A. What I want to do is put the common values ...
1
vote
1answer
82 views

Compare Name field of two object list without loop

I have two Lists(Object) List A has 5 records and List b has 19000 records. What i want to do is compare the name field of list a with that of B. it list b consists of the same name as A, then i want ...
0
votes
3answers
411 views

Removing records in a list with duplicate values

I wanted to remove records with duplicate Reporting_Year__c in a lost. I have got the code and debug shows duplicate removed. but when I test I can see all records inc duplicate list<...
1
vote
0answers
250 views

json.serialize returning null

List<ClassName.CustomerDetails> CustomerDetailsList = new List<ClassName.CustomerDetails> (); ClassName.CustomerDetails custDetails = new ClassName.CustomerDetails(); ...
1
vote
4answers
1k views

Query CustomObject with Attachment

I want to select the fields name__c and description__c from my CustomObject along with the attachments from the attachment object. Can I do this with my query below? What should i write in my inner ...
0
votes
2answers
2k views

Accept and change owner in classic view but not in lightning

I created a custom object and assigns queue to it. And created different list views for each queue. It was doing fine in Salesforce classic the "accept" button and "change owner" is there which are ...
0
votes
1answer
5k views

Convert a String into a List of string

How can I convert a String of that type : 123, 456, 789 into a List<String> ? So I can access to the value 123 for example.
0
votes
1answer
464 views

Error: Compile Error: unexpected token: 'List' [duplicate]

Getting this error: Error: Compile Error: unexpected token: 'List' public String SupportTierValue { get { List tmpAcct = [SELECT Id, Name, Support_Tier__c FROM Account WHERE Id IN ...
2
votes
4answers
3k views

Convert and add list of string to set of ID?

I am tring to add list of string to set of Id . i am trying to avoid one more for loop to again loop and convert using Id.valueOf(). Help me to achieve it. Map<String,Set<String>> ...
6
votes
1answer
217 views

Doesn't Set<T> collection implement Iterable<T> interface? [duplicate]

I am trying to join String elements of Set with semicolon. Set<String> elements = new Set<String>{ 'foo', 'bar' }; System.debug(String.join(elements, ';')); getting the ...
2
votes
2answers
48 views

Grouping and concatenating values in list

My current data in a List of custom data type : Name City Email Phone Plan Jessica NY A@cnn.com 5454 Gold Hannah SF H@cnn.com 2323 Silver Jessica NY A@cnn.com 5454 ...
1
vote
1answer
310 views

Problem extracting values from AggregateResult, results in NULL

I admit that I haven't done too much with the AggregateResult object but I can't figure out how to successfully extract the values to add to a Set. Here's my code: public List<AggregateResult> ...
0
votes
1answer
19 views

Account List by Rep Matrix Report

How can I create a report in SFDC where I can see the target accounts assigned by reps at a glance (in a matrix format), like this:
1
vote
1answer
854 views

Creating a Map with String, Object combination

I have a List of String. This list consist of accountNumbers from Account Object. List<String> accountNumList. I have a child object XYZ__c, which is child of Account Object. XYZ__c object has a ...
0
votes
2answers
1k views

Syntax for passing Multidimensional array

I have a method in my controller util file that parses through some strings to find matches I need to pass in a multidimensional array. When I call this method in various controllers how in Apex do ...
0
votes
1answer
266 views

any shortcut to get set<String> from map<Id,Set<String>> ?

Map<String,Set<String>> st= new Map<String,Set<String>>(); st.put('one',new Set<String>{'1','2'}); Set<string> ss = new Set<String>(); ss.addAll(st.values())...
0
votes
1answer
34 views

Help with VF page RemoteAction getting a List into a Set for update on SObject

I have custom VF page styled with JS. The list of Ids is passed from the VF page based on what the user selects. The List is converted to a Set and The Service method should take the incoming Ids ...
1
vote
1answer
129 views

Inserting record using Test Class vs data loader

I have a situation where I need to test whether the apex classes written in my org does not hit governors limit / anyother issues when bulk data is loaded. I decided to use test class to check this. ...
0
votes
0answers
337 views

Lightning Component - Validate repeating input-form component

I'm working on a Lightning Component for allowing the editing of a list of records. Leaving aside validation, I imagine I would structure it like this: <!--INNER RECORD COMPONENT--> //attribute ...
1
vote
1answer
949 views

How to display a specific list in a component lightning?

I have a JSON and I parse it. Finally I this is my class for parsing the JSON : public class InterlocuteursParser { public class Interlocuteurs { public String contact; public ...
1
vote
2answers
2k views

assign values to a Map<Id,List<SObject>> in an apex trigger

I have below code where I face error as incompatible type. Can someone please help me resolve it? I can't get how to populate it. Apex Code Map<Id,List<Account_Territory_Loader_vod__c>> ...