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
353 views

Marketing Cloud SOAP API send Email to List

I'm attempting to make a SOAP API call to have email sent to a new list every day. The HTML Email is created in Content Builder and works from the UI. The List creation, Subscriber creation(on the ...
2
votes
1answer
33 views

Counter only adds first opportunity id

I have a testclass in which I create serveral opportunities with several values when I system debug these the values are as espected. I use a counter to add the ids from the several opportunities to ...
0
votes
1answer
27 views

Unable to assign or populate a list into a class

I have the following classes (simplified) which I hope will convey enough information to make it clear the issue I am having. I believe the issue in the Role_Definition class where I defined a list ...
1
vote
1answer
755 views

Query Object from Reference Id in Trigger.New List

I'm having issues returning results from a query of the Partner object. I have a trigger written on a custom object that is the child object which has a look-up to the Account object. Ideally I'd like ...
1
vote
1answer
30 views

List iteration - item with space

I am trying to create a very basic static list to iterate through. One of the values has a space in it. I can't figure out how to add the item to the list with a space. In the example below, I can'...
0
votes
1answer
2k views

Aura attribute of type List not accepting an array of objects

I would like to pass an array of objects from my js file to an aura attribute. I know the list contains values and is correct before I pass it to the aura component but the list is empty when I log ...
0
votes
1answer
38 views

how to get responce from url webservice

I have made a webservice to match a phone number and want to return the id of the record. When I test this in workbench this works and have a match. I have a public site with a public class where I ...
4
votes
2answers
574 views

Adding to a List changes all previous additions

I've been working as a developer for about 3 months, so my terminology may be off. I'm trying to add records to a custom object. As the new record information is added to a List, the previous ...
2
votes
1answer
47 views

Clone a List of Custom Data Type

I've created a class of a custom datatype: public class KPI { public String name { get; set; } public Decimal target { get; set; } public Decimal actual { get; set; } public Decimal ...
0
votes
1answer
228 views

unable to delete duplicate article From Developer console Anonymous Window

My profile is System Administrator and have access knowledge object and all the permission assigned like edit,delete,view,view all. I am able to delete duplicate article manually but when i am trying ...
0
votes
2answers
1k 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 ...
2
votes
1answer
3k views

How to return Json string

I have a Get Method which returns an invoice based on id. When I test this with Workbench I would like to have the following response: { "customerId": "1", "addressId": "2018AA123", "invoiceId": "...
1
vote
1answer
278 views

Convert Json to apex by adminbooster class and testclass

How do I use the json2apex tool. I generated an apex code and I am trying to split this in an apex class and testclass but get the error: Method does not exist or incorrect signature: void parse(...
0
votes
1answer
335 views

Pass a List with a custom object type as a parameter

I am trying to increase my code coverage, I have only provided parts of my code that I am trying to cover. I have to create a List to be able to pass over my values into the method. My Errors I have ...
0
votes
1answer
700 views

Map of string and list of integer with apex repeat in visualforce page

i have one map as following : public lisT<integer> testIntList{get;set;} public list<string> departmentsToShow{get;set;} public map<string,List<Integer>> Dep_listToShow{get;...
1
vote
1answer
980 views

How to move my SOQL query outside for loop?

Hello I need some help moving my SOQL Query outside of my for loop to maintain best practices. I am using the code below to get the most recent opportunity of a selected account and grabbing the ...
1
vote
2answers
1k views

Looping over a list of sObjects that has more than object type

I'm trying to access a field from a list of sObjects which holds 3 different objects types. List<SObject> data = new List<SObject>(); for (sObject li : data) { String sObjName = li....
0
votes
1answer
351 views

Updating List with AMPScript

I am looking for a way to update a list using AMPscript by just pressing an update button and going through all of the checkboxes that I am pulling from Marketing Cloud. This is all for a custom ...
0
votes
1answer
179 views

Create Mobile List through API [Solved]

I used Fuel-SDK to create a Email List through API and pushed the contacts in CSVs (SFTP) to that Email List in Marketing Cloud. I would like to do the same thing for the SMS, however the Fuel-SDK ...
1
vote
2answers
43 views

Can we get the Number Value of the list element in VisualForce?

Are you able to display the element number value in a visualforce repeat. For eg: <apex:repeat var="li" value="{!list}"> <p>{!fieldOne}<p> <p>{!fieldTwo}<p> <p>...
0
votes
3answers
32 views

How do place a field value from a map into a list

I have a map from which I want to place the Id's of a field into a List. I tried the following: Map<String, Relatie__c> uniqueHuish = new map<String, Relatie__c>(); for(Relatie__c rc:...
1
vote
1answer
99 views

does apex class api version impacts new features

If my apex class API version is 28, will there be any issue if i try to use List class contains method ? I checked in debug logs, even if class has api version 28, i am able to use List contains ...
2
votes
1answer
1k views

How to reproduce a unique list based on a field value

Lets say I have a list of a sObject with several records which have a some same values in a field/column. What is the fastest way to reproduce a new list with only unique values for this list. Record ...
1
vote
1answer
2k views

How To Use List Custom Settings In Process Builder Criteria

I have List custom settings which I'm using within APEX to determine criteria I should use when building functionality. I have some workflows also however I know I can't use List Custom Settings ...
0
votes
1answer
24 views

Create a new Record on New object by comparing Queries

public class PartialMatchClassPurchased { public static List<Order_Line_Item__c> Partialmatch(List<Id> ids) { List<Commission__c> comm = new List<Commission__c>(); ...
2
votes
3answers
3k views

Null List VS Empty List

I have a basic question about how a list is loaded. Consider these scenarios: List<Lead> leadList1 = [SELECT Id FROM Lead]; List<Lead> leadList2 = new List<Lead>(); List<Lead&...
-3
votes
1answer
41 views

Why are these collections not equal?

I am currently working on the list concepts of apex and working on this piece of code: List<Integer> ages = New List<Integer>(); ages.add(10); ages.add(20); List<Integer> one = New ...
2
votes
0answers
61 views

List resets / doesn't insert the values

I have the following code: public class usersManagement { public Map<String,User__c> usersMap; public List<User__c> selectedUsers; public String retrievedUsers {get;set;} public ...
0
votes
1answer
82 views

Is there any documentation evidence that order of Map keyset converted to List is preserved?

When we execute a code Map<String, String> tm = new Map<String, String>{ 'Monday'=>'\u041f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a', 'Tuesday'=>'\u0412\u0456\u0432\u0442\...
0
votes
1answer
40 views

What is the best way to define and use a large lookup set

The problem seems so simple, but I was not able to this point to find a solution, even after hours of googling. Problem: We push external data into our Salesforce system and have hundreds of cities ...
1
vote
1answer
36 views

Removal of List elements from another Lists?

There are two lists (UserProduct And List Product), each of them holding Product code and Product Name. On selecting a particular user from picklist UserProduct Lists displays Products based on ...
0
votes
1answer
720 views

Creating a filtered list in Marketing Cloud

All, I have in the order of 200k contacts that are synchronised into Salesforce Marketing Cloud from Salesforce CRM. I want to send an email to a limited subset based on a bunch of filter parameters (...
3
votes
1answer
343 views

List<SObject> is instance of SObject?

Object acclist = new List<SObject>{new Account()}; System.debug(acclist instanceof List<SObject>); System.debug(acclist instanceof SObject); The code above prints true true Is List<...
0
votes
2answers
51 views

JSON key set to List conversion using deserializeUntyped

I am trying to extract the 'key' from a json an insert each key to a list (array). Map<String,Object> obj = (Map<String,Object>) JSON.deserializeUntyped(reqestObj); List<String> ...
1
vote
1answer
252 views

“Send List Email” visibility problem

When an email is sent via the "Send List Email" option, only the sender of the email can see the email associated with the Contact when they are looking at the Contact's Past Activity related list. ...
0
votes
2answers
31 views

Can I used addall conditionally?

Can I add a where condition to addAll? Example: mylist.addAll(OtherList where field__c != o); Thanks
0
votes
1answer
1k views

How ro pass an List/array from javascript controller to helper

I have the following attribute in my lightning component <aura:attribute name="serverList" type="Opleiding__c[]"/> I can call this in my javascript controller with var serverList = component....
1
vote
2answers
58 views

Variables undeclared with List<MyCustomMetadata__mdt>

When I changed from the code that's commented out to the current code, the fields from the custom metadata records threw "Variable does not exist" errors. Suggestions on how to correct this? Relevant ...
0
votes
1answer
547 views

list.contains in salesforce not working with wrapper class

My wrapper class is as follow: public class FilterWrapper implements Comparable { public String label {get; set;} public String value {get; set;} public Integer compareTo(...
0
votes
1answer
229 views

iterating a multidimensional List

I am trying to recieve a email with an attachment (CSV FIle) and have it iterate through the csv and upsert it as records in a custom object. i upload the document by hand daily. PAIN! i am using a ...
0
votes
1answer
458 views

Batch apex for account merge DML operation

I have a requirement where I need to merge accounts if a particular field 'vendor_code__c' value is duplicate across the accounts.There is also 2 condition that the :- 1st condition Account of record ...
1
vote
1answer
3k views

System.assertEquals for records in a list? Test class

I have a batch class that inserts Journal records after updating Account records... I am new to apex and cannot think how to test the inserted records in the test class. I have a list to get the ...
2
votes
1answer
25 views

How To get dom documenet value list

Http h = new Http(); HttpRequest req = new HttpRequest(); req.setMethod('POST'); req.setHeader('Content-Type', 'text/xml'); req.setHeader('SOAPAction', action); req.setEndpoint(ep);...
0
votes
1answer
251 views

Retrieve All Subscriber where Add Method is 'Import'

I would like to retrieve All Subscriber from a List where the Add Method is 'Import'. I tryed do a query like this: SELECT * FROM _ListSubscribers WHERE ListID = 2677 AND addMethod = 'Import' But ...
0
votes
1answer
987 views

Assert Map<String, List<sobject>> has multiple values in list

I have a method that returns: Map<String, List<Account>> results I want to have a test class that asserts that the map contains two list records with one string value. I can't figure out ...
0
votes
1answer
65 views

How to test a retun value fom a private class

I have a class where I return a list, how do I pass the retun Value in a testclass. Currently I get the error Variable does not exist: lstRet public static String getPicklistData(String objectName,...
0
votes
1answer
609 views

Deployment error System.ListException: List index out of bounds: 0

I have the following apex code where I do a soql. In my developer sandbox my testclass gives me 100% coverage. When I deploy this to production I get the error: System.ListException: List index out ...
2
votes
1answer
153 views

apex - remove item from dynamic list

The regular Salesforce community sent me here to ask these questions. I'm pretty new to apex and controllers so I'm not sure if I Googled it correctly so please be gentle if this is a super obvious ...
2
votes
1answer
721 views

List.indexOf does not exist?

I have an error in a method using List.indexOf. When running in anonymous window in sandbox, it works. But in production I get the following error: Method does not exist or incorrect signature: ...
0
votes
1answer
1k views

System.ListException: List index out of bounds: 1 in apex share

I am getting below error and not sure how to fix that ? List<Case> csList = [Select Id,OwnerId, (select Id, OwnerId, CreatedById from Payment__r), (select Id,OwnerId,...

1
3 4
5
6 7
14