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
2answers
54 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
28 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
40 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
37 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
0answers
13 views

How to convert a list into a list of lists of size 6 [closed]

So I need to produce an excel file through visualforce that will display only 6 items per work sheet. if I have a list of a custom object, what is the best way to split the list up so I can use an ...
0
votes
1answer
31 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....
0
votes
1answer
27 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
36 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
23 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
29 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
0answers
28 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
35 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 ...
1
vote
1answer
26 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{ ...
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
23 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 ...
0
votes
1answer
35 views

Retrieve and update attribute data from a list

I am building a cloudpage to replace the standard subscription center. I want handle the email list subscriptions in there through checkboxes. I am already stuck at visualizing the subscription lists....
0
votes
1answer
56 views

Aggregating a list of records into two buckets

I have a list that has 2 months worth of records i.e MTD and Previous month. This list is built from JSON response. SubmittedDate IDL (yes/No) SubmittedCount 2019-07-01 Y ...
0
votes
1answer
17 views

Alert user when updating child record based on other related child records

I am trying to display an error when updating a child record. Here's my scenario Parent Bank__c Child Branch__c Relationship field on child BankId__c Updating field on child checkbox Primary_Branch__c ...
0
votes
0answers
29 views

Unable to add data to Data Extension using Automation script Activity

I am trying add data that come from response of SOAP API to get data from list in data extension If response contains 2500 records then I am using for loop to add this data one by one in data ...
1
vote
1answer
41 views

SObject List vs Map instanceof subtype

Map<Id, SObject> sObjectMap = new Map<Id, SObject> (); System.debug(sObjectMap instanceof Map<Id, Account>); // false System.debug(sObjectMap.values() instanceof List<Account>);...
0
votes
1answer
14 views

List type method created and return the same list getting error in return type

Working for pagination on custom object record, using StandardSetController everything initialized but it is giving error that Error: Compile Error: Unexpected token 'return'. at getAgentAsset ...
0
votes
0answers
9 views

Grouping Filtered Records on a Visualforce Page by a Field

I have a custom object called "Availability" that has a couple of field that I'd like to display and I want to be able to filter them by a date range selected by the user through the VisualForce page ...
4
votes
1answer
181 views

Attempt to de-reference a null object: list initialization

I initialize the list at the beginning of the code. In one of the methods, I add values ​​to it. In another method, the list is already empty. But I need these values ​​in the second method. How to ...
0
votes
1answer
42 views

Using AmpScript to update All Subscriber List

Here is my code that executes after a submit button is pressed on a cloudpage %%[UpsertData("SubscribersTester", 1, "Email Address", @subKey, "First Name", @Fname, "Last Name", @Lname, "Monthly"...
0
votes
1answer
37 views

Find the center record in a list from custom object and purge in bi direction

I have a custom object called exception__c and a child object called exception_occurrence__c. There are more than 5000 records in exception object and each exception has more than 25000 child records (...
1
vote
1answer
27 views

Why isn't the type attribute being applied to dataList?

I have a custom component with a dataList component within: <apex:dataList value="{!itemsList}" var="item" type="{! listType }"> <apex:outputText value="{!item}"/> </apex:dataList&...
1
vote
0answers
10 views

How to Access Item in a List of SendEmailQuickActionDefaults

I have the following: List<QuickAction.SendEmailQuickActionDefaults> defaultsSettings = (SendEmailQuickActionDefaults:[QuickActionDefaults.actionName=Case.CC_Send_Email, QuickActionDefaults....
1
vote
2answers
22 views

Unable to assert in test for QuickAction.SendEmailQuickActionDefaults

I have a class for setting a default ToAddress when using a specific email action. See below: global class EmailHandler implements QuickAction.QuickActionDefaultsHandler { // Empty constructor ...
0
votes
1answer
64 views

VF Page Error Incorrect parameter type for subscript. Expected Number, received Text [closed]

I'm getting below error when I'm trying to pass values from map to pageblocktable in Visualforce page. ERROR : Incorrect parameter type for subscript. Expected Number, received Text VF PAGE : &...
-1
votes
1answer
37 views

Creating fulsome combinations of list elements

I have been having some issues getting the logic down for the following: Simplifying, I have an N-element list of Skids defined as: public class Skid { public Integer length { get; set; } ...
0
votes
1answer
41 views

List.Add() not working

I've got the following code snippet in a trigger handler class x1 = trigger.new; List<Id> listx = new List(Id); For(integer i = 0; i < x1.size(); i++ ) { System.debug('Loop ...
0
votes
0answers
43 views

Sending email in Pardot Engagement Studio using dynamic list during business hours

There is a program in Pardot Engagement Studio having 3 simple steps - start/entry point - a dynamic list, send email, end. The email is to be send on weekdays during business hours. The dynamic list ...
1
vote
0answers
58 views

how to avoid system.limitexception too many soql queries 101 in apex classes [closed]

when I am trying to deploy the component then I was getting this error like system.limitexception too many soql queries 101 how to avoid this? ====================================== /** * @...
1
vote
2answers
153 views

Illegal assignment from Id to List

I have a real quick question. Usually when I want to get a list of IDs as a List i'll do something like: List<String> voterIds = [select ID, from Vote__c where suggestion__c =: recordId].ID; ...
1
vote
0answers
51 views

List Button is not passing parameter in URL for a particular profile

I have a list button on a related list of custom Object ABC under Contact object which redirects to a VF page (custom record creation page for ABC). I am passing contact id in the URL so that contact'...
1
vote
1answer
64 views

Do Maps have an Reliable Relationship between keySet() order and values() order?

Let's say I have a map, for example: Map<SObjectField, SObjectField> valueByKeyMap Assuming neither the Map nor its contents are mutated by other activity in the system, can I rely on these ...
0
votes
0answers
14 views

Rule group within a rule group in Pardot

Is it possible to have a rule group within a rule group while creating dynamic list in Pardot?
0
votes
1answer
35 views

Wrong format of JSON Array after a successful POST using Apex Class

I've been trying to create a List from the Account object, filtered by their record type, to be sent to our website using the Apex Class. I managed to create the query correctly and it returned the ...
0
votes
0answers
31 views

How to check List contains?

I would like to check if List contains the serialnumber. 1.User select items. 2.Next page, user select options. Items and options are related by serial number. So, User want option-select-page to ...
0
votes
1answer
25 views

Using both lists and data extensions at the same time in for email and SMS sending?

So I know this isn't the best practice but is it possible to use both lists and data extensions in marketing cloud without any complications? Use case could be like: I use lists when I want to send ...
0
votes
1answer
28 views

Putting a List Inside the value of a map

I am getting an error Error is in expression '{!setGroupBy}' in page customjobapppage: I tried multiple approach and I ended up with this: so this is how i Initialize my map public Map<...
0
votes
1answer
85 views

pass list<string> value in test class

In my class one list of string is there which is get;set; type. i want to pass the value in test class how to do this public class MYController(){ Public list<string> selectedDelList{get;...
0
votes
1answer
43 views

List items not getting removed

I want to remove Accounts from List to which user doesn't have access. Here is my code. However in the debug logs, I can see all the accounts, that is none of them are removed. query += QUERY_BASE + ...
0
votes
1answer
47 views

How to identify similar records in a List and then updating corresponding fields

trigger setCertificationToFailed on Exam__c (after update) { List<Exam__c> ExamList = new List<Exam__c>(); ExamList = [SELECT Id, Exam_id__c, Exam_state__c, doNothingExam__c, ...
0
votes
1answer
38 views

How to iterate map and assign value to field in lightning component?

I have list of account Ids in an array and list of accounts in array. I need to find the account Ids from the account list and want to change the status field. var accId=[]; //holding accIds var ...
6
votes
1answer
441 views

How can I query the supported timezones in Apex?

Apex provides a TimeZone API. You can use this to query the detail of a time zone, named using its "SID" (a value like "Europe/London" or "America/New_York" for example). However, this API doesn't ...
7
votes
2answers
217 views

SOQL: Populate a Literal List in WHERE IN Clause

I need to query for an object based on 2 string variables. The first one is a constant but the second one gets passed to the class constructor. So in the end I want to achieve something like this: ...
-1
votes
2answers
70 views

How to remove list elements without an additional for loop?

I need to remove from the following revenueList list all elements where newRevenueDate is NULL without any additional for loops. List<Revenue__c> revenueWithNoDateList = new List<Revenue__c&...
8
votes
1answer
94 views

How can I safely cast a List<sObject> to a specific concrete type?

I have a List<sObject> genericList in scope in a method. The list was created and populated elsewhere and passed in as a parameter. It could be: a List<sObject> that is homogeneous. E.g. ...
0
votes
1answer
31 views

Where to look for in debug: list index out of bounds

I am trying to debug a piece of code where I get the error : list index out of bounds: 0 In this case do I need to look for:ZcheckoutBaseFor.validateConfiguration() or could this also be :...