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
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
26 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
votes
1answer
63 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
39 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
17 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 ...
1
vote
1answer
32 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:...
-1
votes
1answer
34 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}, ...
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
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 ...
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
2answers
62 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
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
1answer
74 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
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 : ====== ...
0
votes
1answer
81 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
30 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
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
36 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
36 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
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 ...
0
votes
1answer
39 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
57 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
32 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
43 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
10 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
228 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
69 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
38 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
29 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
11 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
26 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
92 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
75 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
66 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
201 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
96 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
66 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 ...