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

List index out of bounds: 0 in execution batch - Send email

I am trying to understand what may be going on. My code basically sends emails through a batch. However, in the executions it is giving the error "List index out of bounds: 0". I can't find ...
1
vote
1answer
101 views

LWC JavaScript way to copy List [List A, List B] Values to a single List

I'm looking for a way to copy wrapper list of content values to a single list Example: LIST<wrapper> dataAandB= [LIST A,LIST B] => List A =[Object X :{Id,Name ... }] and List B =[Object Y :{...
0
votes
1answer
32 views

Parent ID not updating on Attachment [closed]

I have a requirment where when 2 records are merged, the attachment related to merged record should be inserted to parent/master record. Below is my code related to this List<Attachment> attObj =...
0
votes
2answers
40 views

Error: Id not specified in the update call

Below is my apex method where I'm updating Account_Transfer__c Records private static void linkPoliciesAndHandleApprovalFlds( List<string> selectedPoliciesSet, Account_Transfer__c ...
2
votes
1answer
60 views

Map changing the order of key value pairs in apex

I am creating a map from a string stored in a specific format. But Adding the key-value pairs and later displaying it, I notice the order is not maintained on the map. Is it possible to maintain the ...
0
votes
1answer
37 views

How to differentiate values in a list

I have a list with records from Policy__c which is a custom object. List<Policy__c> PolList = New List<Policy>(); PolList = [Select ID, Code__c from Policy__c]; Now from the above query, ...
1
vote
0answers
18 views

Flow condition using CONTAINS doesn't work properly

I'm working on a flow, and basically I'm trying to compare number values with an "Array". when I debug d the flow, the condition fails: DECISION: verificarMesAProbar Skipped this outcome because its ...
0
votes
0answers
29 views

Pipe delimiter to generate CSV programmatically in apex

I am trying to generate CSV file with the pipe | as delimiter but the issue that I am facing is it is converting separator into &#124; For example, if csv headers are contained in the list shown ...
3
votes
1answer
31 views

If I know the class type of an Enum, how can I get a list of the values?

I have the following method: public XAP_ENUM_EnumConverter put(Type enumType, XAP_ENUM_EnumWrapper enumWrapper) { ENUM_WRAPPERS_BY_TYPE_MAP.put(enumType, enumWrapper); return this;...
-2
votes
1answer
30 views

Is it possible to merge Data from List and Data Extension via query in Marketing Cloud? [closed]

Is it possible to merge Data from List and Data Extension via query in Marketing Cloud? I need to create a Data Extension with SubscriberKey from the list and FirstName from the Data Extension. Which ...
0
votes
0answers
21 views

What would be the best way to strip values from custom list elements?

I have a custom list list<ExistingAccountResult> that contains the following values: ([accountid=00111111111w5YIQAY, includeinfunnel=true, masterid=11111111, salesforceaccountid=O-22222222, ...
0
votes
1answer
21 views

Is it possible to get all lists associated with a list email using the Pardot API?

I would like to find the lists associated with a list email using the Pardot API. The list query doesn't seem to support parameter values that would allow for this type of query. Is there any way to ...
0
votes
0answers
24 views

Get unique set of string values from a query

I have a custom object called Asset__c in which there is a lookup field called Site__c which is linked to another custom object called Site__c. This Assets object has more that 20k records. What i ...
0
votes
1answer
40 views

Using Trigger.new List and Map compare new contracts with old contracts

I'm trying to compare dates of old contracts and new contracts (trigger.new) from the same account, the new contracts are imported and are from a lot of different accounts. But the performance of it ...
0
votes
1answer
26 views

Dynamically checking the values of a wrapperClass for a validation

I have a wrapper class. public class wrapperClass{ String s; Date d; Integer i; Id id; } There are different operations for which certain fields are required on these wrapper object. Example 1. for ...
0
votes
1answer
25 views

Is there any way to get the first 10 from the list of objects in APEX? [duplicate]

I need to get the first 10 object from the list that comes from the Query without limiting in the query notifs = [SELECT id FROM Notification__c WHERE Read__c=false ORDER BY ...
0
votes
2answers
30 views

Trying insert new contact with condition, with below code it is not happening

I am trying to add a new contact record with below condition where Account has greter than 99 employees an limit is 1. THough new contact is not getting created in accounts where employess are ...
0
votes
3answers
47 views

how to pass subquery als list into map

I have a soql with a subquery. What is the easiest way to pass the id of the query and the list of the subquery into a map. Do I need to create a loop for the subquery and ad them first to the list? ...
1
vote
2answers
42 views

Any limit for map collection size for ReadOnly page

Context Since Lightning component Aura or LWC does not support @ReadOnly mode yet, we have opted for a Visualforce page to export queried data into an Excel and benefit from higher query rows limit. ...
0
votes
1answer
17 views

In List Of List I am not able to assign List of list to SOSL

list<list<sObject>> Mylist = New list<list<sObject>>(); Mylist = [ FIND {IBM} IN ALL FIELDS RETURNING Account(name),Lead(name)]; System.debug(Mylist);
0
votes
0answers
17 views

Create a list of accounts and access their fields

I am tackling a Salesforce APEX - problem which is probably quite straight forward but I can't figure it out: I have extend the code from https://developer.salesforce.com/docs/atlas.en-us.pages.meta/...
0
votes
2answers
99 views

Method does not exist or incorrect signature: void get(Decimal) from the type List<Decimal> (32:49)

I am new to Apex and cannot seem to find a solution to the error below on the last line of code. The error I get when compiling is "Method does not exist or incorrect signature: void get(Decimal) from ...
0
votes
1answer
39 views

LWC for:each issue in rendering list. Cannot use calculated id

I am trying hands on in lwc . Got stuck while I want to do something which in aura was like: <aura:iteration items="{!v.serverResult}" var="item" indexVar="i"> <li role="presentation" ...
-3
votes
1answer
41 views

Split the list in apex [closed]

I am having the list . List has 28 records. I need to split the records in the list into 13 + 13 + 2 in the code. Is it possible?. If it is possible how to do that? Can anyone help me with this? ...
1
vote
2answers
57 views

How to pass a list of string values to a picklist in a flow

I currently pass a list of strings from my apex class to a flow. The list of strings {!cancellationReasonsList} I pass to a choice recource. The choice recource I pass to a picklist. Instead of ending ...
0
votes
1answer
40 views

How to get current user flow in apex

I am calling an apex class from a flow (in flow debugger) where I want to get the current user/starter of the flow. I tried to get the user with apex but get a system nulpointer exception. I also ...
1
vote
2answers
29 views

How do I invoke an apexclass from flow and return a list back to flow

I have a flow from which I want to call an apexclass and retrieve a list of picklistvalues so a user can select from these in a flowscreen. How do I achieve this. I tried the code below but when I use ...
1
vote
1answer
34 views

VisualForce page, PDF, styling list items

Normally, using CSS it is possible to add a white space between the bullet or number and the text behind it. <ul> <li style="padding-left: 10px;">Text entry</li> <li style="...
0
votes
0answers
15 views

Use Community HTML Component to create nested unordered list in an ordered list

I am trying to use HTML code to create an unordered list nested in an ordered list. No matter what I try, the nested list has numbers in it. It isn't functioning like straight HTML. Can anyone get ...
0
votes
0answers
27 views

Open rates for each list for an email sent out to multiple lists

I have sent out a list email to multiple lists, for instance Boston and Chicago. I'd like to view metrics like open rate, etc for each list. I am able to view these metrics for the email as a whole, ...
0
votes
1answer
28 views

Pageblocktable not showing records

I'm querying Task record from contructor and displaying in Pageblocktable but it's not displaying records in Pageblock table. Could you please let me know what went wrong? <apex:page ...
0
votes
1answer
31 views

Unittest eror: System.NullPointerException: Attempt to de-reference a null object

I am writing a unittest for my apex class but get an error System.NullPointerException: Attempt to de-reference a null object on my unittest for variable: testoptions Apex class public class ...
0
votes
1answer
18 views

How to test a List<SelectOtion> in unittest

How to test a List<SelectOtion> in unittest. I have the following apexclass public class WebToObjAttachments { .. public List<SelectOption> CountryOptions { get { ...
0
votes
1answer
26 views

Bulk Updating Records in Apex from List?

I am writing code that calls an API to get external client info. I'm at the point where I have it working but I am wondering if there is a more efficient way to save the data to the Account object. ...
0
votes
1answer
21 views

Building out a multi-dimensional array / list for an update statement

I have a contact list I am looping over and one of the fields in the contact object holds 1 or more contactIDs in a delimited list using a carriage return. Standard Contact Object: ContactId: ...
1
vote
1answer
33 views

Sort range values of List<String>

How to sort below List ranges in ascending order. ranges= (1-10, 11-20, 201-500, 21-50, 501-99999, 51-200) Tried with ranges.sort() and it is not working.
1
vote
1answer
405 views

How can I remove Change Owner button from a List View in Salesforce?

How can I remove the Change Owner button from a ListView in Salesforce?
0
votes
0answers
28 views

Adding Subscribers to List via SDK

My integration team is trying to add subscribers to a list via the SOAP API and while the user is getting added to 'All Subscribers' it is not being added to the list in each child account. Below is ...
0
votes
0answers
13 views

Use flow loop to add the parent to a list

I have a master-detail relationship between Account and Property Agreement: I'm using a "Get records" element to browse through the child records and I need to add the parents to a list. I tried ...
0
votes
0answers
16 views

Is there any limit in creating fields in Profile managent

I want to display about 250 fields in the All Subscribers list. So is it possible to do that or is there any restriction on the number that can be displayed.
1
vote
1answer
40 views

Passing List into Apex - Want to insert individual attributes from list

I'm having some difficulty with lists and apex. I have a list declared in my lightning component, please see below: <aura:attribute name="AssetsList" type="List" default="[]"/> I then set ...
0
votes
1answer
53 views

searching contacts in Auto-Suppression Lists

I want to know if a email adress is member of a Auto-Suppression Lists. (without exporting it as an csv). Is there a chance?
0
votes
1answer
26 views

Unable to Compare two Strings in Salesforce - APEX

I am trying to Compare two strings which are delimited by SEMI-COLUMN (;). I have made sure I SPLIT them and the store them in lists. In the below example, I receive an error for BALL for all other ...
0
votes
1answer
31 views

How to populate a long text field from map values?

I'm trying to populate a long text field with phones from many contacts, but I don't know how to do it. I want to populate a field called "Authorized Contacts" with all phone numbers returned from a ...
0
votes
0answers
20 views

Listing Opportunities

I've been trying to list opportunities in my account. There are only two opportunities created by me in salesforce. But while listing the same, more than 30 are shown in the list. I tried to filter ...
0
votes
1answer
33 views

List is not constructed in memory until I print it

I'm confident that I'm missing something here. I'm not able to evaluate a list of Ids until I print it using System.debug. In the snippet below, I take a list of Accounts and extract the Ids from ...
0
votes
0answers
57 views

Converting a List to a Boolean

I have a query: public static List<ID> returnUserPermIds(){ List<PermissionSetAssignment> permissionSetAssignments = [SELECT PermissionSetId from PermissionSetAssignment where ...
0
votes
1answer
71 views

Illegal assignment from Id to List Error?

I am getting an error like duplicate iD. Wrapperlist is a List of contact id taskId = '00T****005ezShPEAU'; list<task> updateTask = new list<task>(); Type idArrType = Type....
0
votes
1answer
38 views

how to empty a list without removing the list

According to the documentation, the SSJS function associated with the object list are : add, remove, retrieve and subscribers https://developer.salesforce.com/docs/atlas.en-us.mc-programmatic-content....
1
vote
1answer
35 views

Illegal conversion from List<ActiveContactListController.ContactsWithRoles> to List<AccountContactRelation>

i have this code i getting the error the following error, i'm new to salesforce developer someone can help me? public class ActiveContactListController { @AuraEnabled public static List&...

1
2 3 4 5
14