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

Is SubscriberKey the only field you can query from a MobileConnect list?

I need to query a MobileConnect List to delete some Contact records. I created a MobileConnect List and then used automation studio to query it into a DE. This worked fine BUT is SubscriberKey the ...
1
vote
1answer
24 views

Parsing map to get list of objects based on Key

Is there an easy way to extract the list of objects from a map containing list of objects? For ex, below is an example map that I need to deal with. map<Id, List<Contact>> ...
0
votes
2answers
29 views

Querying for users in a a Role based on Role Id instead of RoleName or DeveloperName

List<User> usrlst = [SELECT Id FROM User WHERE UserRole.DeveloperName LIKE : '%Customer_Support_Representative%' and IsActive = True]; The problem with this is that we changed the name of the ...
1
vote
1answer
42 views

Apex cast List<Object> into List<SObject>

My method returns a list of Object. I wanted to add that to a list of specific SObject. List<Account> accList = new List<Account>(); List<Object> objList = new List<Object>(...
0
votes
1answer
31 views

List Remove - I run always in “List Index out of bounds”

First, I add all rows of my Mail into a list. If the Listitem is also a item of my set then I want to remove this item list. I tried to remove items from my List "RestMail", but the code ...
1
vote
2answers
50 views

How to find duplicate records from the list based on 2 fields values?

I have a requirement where I need to find duplicates and remove from the list, but I am unable to figure how to iterate and remove duplicates. Can anyone please help me with this? I don't want to use ...
0
votes
0answers
32 views

Iterating through a List and create another list

I'm trying to iterate through a list and create multiple records with it but I am not able to. The list is created and filled with the changeHandler event: if(event.target.name==='psProduct'){ ...
0
votes
2answers
24 views

How to combine 2 String List into a List<List<String>>

I have two lists List list1 = {a,b,c}; List list2 = {d,e,f}; I need to combine both of them into a List<List>, so that when I try to access combinedList[0][0] - display 'a' combinedList[0][1] - ...
0
votes
0answers
4 views

Can i use a publication list to filter a data extension?

I've created a multi-step journey (email then SMS). We want to send the email and SMS to a publication list created just for promotional emails. I've selected a data extension as an entry-source then ...
0
votes
1answer
14 views

Iterate over fields from a list

I'm doing a query which returns always 1 record, but I need to iterate over the fields from that list, how can I do that? I was trying to do the way below but this doesn't work, I really need to ...
0
votes
0answers
25 views

Whenever I am doing any exercise on Opportunity object I also get the error Ilegal assignment from list<Opportunity>to list<Opportunity>

List<Opportunity> oppList =[ Select Name, StageName, CloseDate from Opportunity];
0
votes
1answer
44 views

For loop inside For

I want to avoid this For loop inside another For... Is there any way for my situation? public class ManagerAccountTeamMember { public static Boolean isFirstTimeBEFORE = true; public static ...
0
votes
0answers
16 views

Sort List by CreatedDate [duplicate]

I have a following wrapper class: public with sharing class HistoryRecordWrapper { Id CreatedById; Datetime CreatedDate; Object Field; Object NewValue; Object OldValue; public HistoryRecordWrapper(...
0
votes
1answer
83 views

Ho to dynamically deserialize untyped a JSON with list

I have a JSON payload which is changing a lot so I want to create a way to dynamically deserialize the payload. My starting point is that the payload will consist of max 5 nested lists 5 levels deep. ...
-4
votes
2answers
128 views

JSON array into map with duplicate values [closed]

Final result when i tried the below code.
0
votes
1answer
52 views

Error: Invalid conversion from runtime type List<ANY> to Map<String,ANY>

I am trying to dynamically deserialize a jsonstring (fieldmaplevels wil also be in custom metadata settings) but get the error: Error: Invalid conversion from runtime type List to Map<String,ANY>...
0
votes
1answer
49 views

Need a duplicate values in the Map

I have a list of the string contains duplicate values and I want to retain the duplicate value also in the Map and my code is below my list contains only 2 values while iterating in for loop I want ...
-1
votes
1answer
28 views

execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment to SObject External entry point

I have created a trigger to update the Priority of a custom object (JIRA_Issue__c) when the Priority of the related Case is updated. So Basically when a JIRA_Issue__c is created for a related Case, ...
0
votes
2answers
46 views

Apex - List findIndex

How can I do like findIndex from List in Apex? I wanna do like below. public class SelectItem { public String Text { get; set; } public String Value { get; set; } } public void FooMethod() { ...
0
votes
0answers
23 views

Run Automation When A Data Extension is Updated

I have an external system that accesses Marketing Cloud to send an email, we are selecting users from that external system and then it updates a Data Extension in Marketing Cloud moments before it ...
0
votes
0answers
20 views

Is it possible to run a report of all Lists that are marked as 'public' in Marketing Cloud?

I have recently started at a company that has a LOT of List and Publication List Sub-Folders in Marketing Cloud. Looking at the Subscription Center, it looks like at least some Lists have been marked ...
0
votes
1answer
21 views

List to Set conversion is not working properly in APEX

I assume that this is a pretty basic question but I am wondering why I can't be able to convert a List of String to a Set of String. I have tried the below snippet but didn't get the unique string ...
0
votes
0answers
40 views

Help with changing a line on a list class in apex code

I am pretty new to coding and just need help on adding/changing the following line in my apex code so it queries the RecordTypeId as well as the OpportunityId from the record that my lightning ...
0
votes
0answers
53 views

Rendering a List<Map<String, Object>> in an LWC

I already posted a question about this, but I'm asking it again, differently. I'm importing a getFiltersJson apex method to my component (what it does, is export some filters I created in another ...
0
votes
1answer
22 views

Sort list by 2 fields - one is a text field containing numbers

I was hoping someone could help. I'm creating the below list and trying to sort firstly by Step_Order__c and then by Field_Order__c. List<Contract_Generation_Wizard__mdt> mdtList = [SELECT Id, ...
0
votes
2answers
34 views

Assign Map keys and values to Account

I have a map acctMap<id, decimal>. The keys are accountIds and value is a custom field. How to assign map keys to account ids and set the custom field to be the map values, so that I can update ...
1
vote
1answer
79 views

JSON with parent child data from list in apex

I am facing issues while adding list data: Here is my code: public class Wrapper{ public Boolean open{get;set;} public String label{get;set;} public String key{get;set;} ...
0
votes
0answers
17 views

id in returl goes missing if there is any action performed in enhanced list

I have a custom object Event which is associated with Account object. There is an ‘Add Account’ button in the Account related list under Event details which opens a VF page which shows Account list ...
-2
votes
2answers
119 views

Trigger After Insert - relate Case field with ContractId [duplicate]

Use case : Once contract is created with : record type = B2C AccountId = Case.AccountId ContactId = Case.ContactId GEG_Correspondance_Offre_Produit__r.Type_Energie__c = Case....
0
votes
1answer
41 views

How to check multiple occurrences in the child records?

I have a custom object called "Revence__c" with fields "profit1__c" and "profit2__c". Another custom object called "Product__c" is the parent of "...
0
votes
2answers
45 views

Convert Set to list within a map to sort

I have an existing method where I am looping through OpportunityTeamMember records to get the names and am putting it into a set so I get the unique values, this is working fine. However, I need to ...
1
vote
0answers
30 views

Is there a way to pass a dynamic list into a ListView component?

When using a ListView lightning component, is there a way to pass a dynamic list in as opposed to an existing List View? Or would a list view have to be made completely from scratch in order for that ...
0
votes
0answers
11 views

Does Marketing Cloud no longer offer option to copy publication list from one list to another while keeping the original list?

I am trying to copy my subscription/publication lists from the "Shared Publication Lists" to "Publication Lists". In the documentation below it states that you can indeed add ...
0
votes
0answers
27 views

Best way to accomplish individualized List View based on public group membership?

I'm currently attempting to resolve an issue with an out of the box List View that is providing all users visibility on custom objects they should not be able to see. However, these users do need ...
0
votes
2answers
83 views

Trigger with bind Variable

I created a trigger on account object, that needs to populate a number field called 'ContactPhones'. The input of ContactPhones, must be equal to the related contacts of the inserted account, with the ...
0
votes
1answer
21 views

Can't send to a list in marketing cloud?

Created a list with one subscriber email, however I'm not seeing any option to do a send when I checkbox on the list in the actions. What is the solution to this? Thanks in advance.
0
votes
1answer
66 views

Trigger with count SOQL

I need to count how many fields were populated in a lead, every time a Lead is created. I'm using the count() statement, to query the fields that need to be counted. In the trigger, the following code ...
1
vote
1answer
50 views

How to use 2 objects in an sObject list

I need to use fields from 2 different custom objects in a VF page apex:pageBlockTable. How can I use a List to put 2 objects in a single list? public List<Recipient__c> recList{ get { ...
0
votes
1answer
27 views

Contain function in SET check only first element not all the element

I am not getting why It is not giving me the correct output. If i Test 0011b00000sXK8mAAG id then result is YES or if i test any id from (0011b00000sXKBgAAO / 0011b00000sXKgDAAW ) then it gives me No ...
0
votes
0answers
11 views

apex:pageBlockTable with multiple objects in custom controler

I need to create a record list where users will input fields in an apex:form and each record will add to an apex:pageBlockTable where user will click submit button and ultimately insert all records in ...
0
votes
2answers
92 views

Retrieving a Salesforce Id from various objects based on key values

Working to bulkify operations in an Apex REST method. I need to lookup Salesforce Ids for multiple fields in a number of objects (custom and built-in). Would calling a method like this from within the ...
1
vote
1answer
59 views

Dynamic query using In with a List with multiple fields

I have an array of this class global with sharing class JiraTimeLog { public Long worklogId; public String jiraIssue; public String milestone; public String resource; public Date ...
-1
votes
1answer
33 views

List Order by number value [closed]

i convert json to list: [ { name: "file.png", time: 1600813341124345 }, { name: "file2.png", time: ...
0
votes
1answer
39 views

apex repeat with dynamic list

i have a json string { "kind": "storage#objects", "items": [ { "name" : "image.png", "id": "id_1", &...
0
votes
0answers
73 views

Mass Update Lead status dependent picklist in the listviews

Currently inside of Salesforce list views, users have the option to select leads and change their status in mass. However, when user select “unqualified” or “Nurtured”,as the lead status ,the user ...
1
vote
1answer
257 views

LWC: Read entries from custom Object without creating Apex Class

how can I create a list of entries from a custom object in Salesforce without needing to create an Apex Class with this list? using only the JS and the HTML files from the lightning web component? JS ...
0
votes
0answers
23 views

How do I write the test class for List input and output [duplicate]

How do I make a test class for this getOrderStatus below. Input value is List of undefined Object( we do not have this in our object) and Output is also. public with sharing class ...
1
vote
2answers
177 views

How to deserialize list with map to wrapperclass

I have a string which I am trying to deserialize to a wrapperclass / object. But get the error: Expected Map<String,String> but found [line:1, column:3] Wrapperclass global class ...
0
votes
3answers
65 views

Comparing Two Lists of Different Objects

I have two lists for two different objects. They are both are related to opportunities. I want to check to see if the two lists are associated with the same opportunity and, if they are associated ...
0
votes
1answer
75 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
2 3 4 5
15