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.
879
questions
0
votes
1
answer
47
views
Best way to convert Set<Id> into List<Account> in Apex?
What is the best way to convert Set<Id> (considering all Ids are of Account type) into List<Account> in Apex?
-1
votes
1
answer
39
views
Is there anything that can be done to make List Views update without having to refresh my page?
One example, when I am viewing an "All" list view and I open a record from that list that is not currently part of my "Recently Viewed" list view for that object, then navigate to ...
1
vote
1
answer
31
views
How can you access a dynamic related list from an object?
I have a dynamic related list "Qualified Contacts" in my Account object, that filters contacts based on tenure (custom field). I want to access this filtered list in a trigger, however I ...
-1
votes
1
answer
99
views
DML on Sobject List
I have a scenario where I need to reduce DML calls. I'm performing DML on two objects that have a lookup relationship. I'm currently collecting the records in a list of SObjects and then performing ...
2
votes
1
answer
97
views
How can i change default list view for custom object
I have a custom object called "Customer Successes". I can not figure out how to change the view so that when i click on the tab at top, i see the view selected in image. Currently, I have ...
-1
votes
1
answer
120
views
Adding new prospect to a list using API
I am writing some automation in Python to push prospects into a Pardot list. I thought the list endpoint would help me acheive this. But, it only gets the metadata of the list. Is there any endpoint ...
0
votes
1
answer
74
views
How to merge objects in query?
I have 2 custom objects. Let's say its customObj1__c and customObj2__c.
List<customObj1__c> obj1 = [SELECT Id, Name__c, Age__c FROM customObj1__c ORDER BY CreatedDate ASC];
List<customObj2__c&...
1
vote
0
answers
926
views
How to call the LWC/ Aura Cmp in List View Buttons directly?
We are moving Salesforce Classic to Lightning. In that process I have a Opportunity Object . In that Opp List View I have a "Reset", This is an OnClick JS button. Now for this button I ...
0
votes
1
answer
46
views
Compare 2 Lists of same sobject and store the unique records in a list
I have 2 List<Sobject> one contains existingRecordsList and other updateRecordList.
existingRecordsList = (Account:{abc__c=a0o7a000,xyz__c=a0o5r000, id =a0o5r000002GaHhAAK})
updateRecordList = ...
-1
votes
1
answer
44
views
How to disable inlinedit option on list views for a specific profile only?
How to disable Custom list view inline-edit option for fields for a specific profile ? .
0
votes
1
answer
71
views
SOQL inside invocable method returns no results
I have an invocable method which is invoked when a platform event is published. So far the invocable method invokes on time and some elements of the data are extracted from the platform event.
Now ...
1
vote
1
answer
89
views
List of Strings is empty in @Future-method
So I have a list of Strings which is populated with Ids (in form of Strings) in the batchProcessSchedules() method. By reaching the limit (size) it will pass this list, together with another list and ...
0
votes
1
answer
113
views
there must be only one primary contact on account by utilising isprimary checkbox
stuck in here What if someone uses dataloader and make 2 contacts for same account as primary, then my code is not working
public class Contactispr {
public static void Conta(List<Contact> ...
0
votes
0
answers
45
views
How to use the List<Account> value created in ApexClass in Visualforce Page
My Apex Class is like this.
public with sharing class displayWarning {
ApexPages.StandardController controller;
public displayWarning (ApexPages.StandardController controller) {
this....
-1
votes
1
answer
75
views
apex list of object
I have a list of objects:
List<Volume_Detail__c> listVolumesDetails = new List<Volume_Detail__c>([SELECT Id,Year__c,January_Volume__c, April_Volume__c,Volume__c FROM Volume_Detail__c ...
0
votes
1
answer
613
views
Custom Settings - Unable to access or see custom setting in Flows
I created a Custom Setting with Visibility - Public & Type - List to reference in Flows. But I don't know why I can't find the value. I noticed other Custom Settings with Type - Hierarchy are ...
0
votes
1
answer
54
views
Not able to add list<String> BCC to setBccAddresses ,VARIABLE_ASSIGNMENT [885 line] common.apex.runtime.impl.ScalarList@3fc50cb5
FYI .........If I remove this BCC code emails are going fine.
enter code here
public static List<Messaging.SingleEmailMessage> listEmailMessage = new List<Messaging....
0
votes
1
answer
1k
views
How to iterate over map with id and Sobject list
I have the following piece of code:
map<id,List<Spot__c>> spotMap = new map<id,List<Spot__c>>();
List<application__c> apPList = [SELECT ID, Account__r.id,(SELECT id,...
0
votes
1
answer
316
views
Split up the field and form new map in Apex
I am having one unique scenario, as if ResV is coming as below in the list
List<AsQres> assresponseMulti = new List<AsQres>();
output as below -
(ASQREsponse":{
Id=0jb2z000000Cauijui,...
0
votes
2
answers
111
views
update fields in a records which is coming as a string
I am getting fields and its values in form of a string, for example:
field1*Value1,Field2*Value2,Field3*Value3
I need to update above 3 fields in a record with their given values.
Object ob=new object(...
0
votes
2
answers
182
views
How can I bulk search Subscriber Keys for imported lists to Marketing Cloud?
I work at an organization that frequently hosts webinars. We use marketing cloud to send generic, full subscriber list emails promoting these events. But we also use it to send follow-up emails to ...
4
votes
1
answer
714
views
What is the 'ids' system variable in salesforce?
I am recently working on a project to pass selected records from a list view to a screen flow. I pretty much have it working, but there is one aspect I am using that I really don't understand, and I ...
0
votes
1
answer
61
views
HTML conditionnal List
I have a Data Extension with 3 variables/columns.
In my email, i want to display the content of these 3 columns as follow :
Your products :
○ %%ID_Product_A%%
○ %%ID_Product_B%%
○ %%ID_Product_C%%
My ...
0
votes
0
answers
58
views
Unable to parse JSON with list
Currently, I'm trying to access JSON with the list included, but when I tried to access the organization from the matches list it's saying variable doesn't exist. Please let me know how to fetch the ...
0
votes
1
answer
193
views
Receiving this error "Method does not exist or incorrect signature: void add(OpportunityTeamMember) from the type List<List<OpportunityTeamMember>>"
I am trying to pass a list of records back into a flow as a collection variable but keep hitting this error Method does not exist or incorrect signature: void add(OpportunityTeamMember) from the type ...
-1
votes
1
answer
1k
views
Only "Recently Viewed" option for list view
It seems my only option to view leads is "Recently Viewed". How can I change this?
0
votes
1
answer
146
views
getting attempt to de-reference a null object while assigning value to a list
List<SIM_Cam_Request__c> requestRecordList=new List<SIM_Cam_Request__c>();
requestRecordList = [SELECT id, name, SIM_Cam_System_Role__r.Name, deletedSimCamSystemRole__c, FROM xyztable ...
-1
votes
1
answer
254
views
Subscription Method of a Subscriber in SFMC
I'm in need of Subscriber source details. As I'm going through each report, I found List demographics give Subscription method details but not at the subscriber level. Do we have any feature in the ...
0
votes
2
answers
5k
views
hide the delete button in a related list for a custom object
How can I hide the delete button for a record in a related list for that record's object?
0
votes
1
answer
134
views
Convert String of primitive type to a List of primitive type
I have a case in which we got some text-area fields that can have a list of String, Integer, and Decimal as a String.
for example, the field can have: 1111,2222,3333,4444,5555
another example, the ...
0
votes
2
answers
127
views
List has no rows for assignment to SObject when tried to Get All Manager Id
I have a problem with this code , I trie to get all the list of account for the five manager of the user , I used this code but I get this error :
List has no rows for assignment to SObject
This is ...
0
votes
1
answer
1k
views
What is the recommended place in SFMC where subscribers's custom user-preferences for emails should be stored (i.e. custom email subscription center)? [closed]
Goal: I am looking into creating a custom user-preference center for subscribers in SFMC (to manage email preference - like offer email, newsletter emails, etc - i.e. custom email subscription center)....
-4
votes
1
answer
78
views
Error: illegal assignment list to list [closed]
@RestResource(urlMapping='/Contact')
global class WSgetcontact {
@HttpGet
global static list<contact> doGet() {
WSgetcontact.contactproductwrapper result = new WSgetcontact....
0
votes
2
answers
3k
views
Passing List of Ids from LWC to Apex
I am trying to pass multiple opp Ids in order to link a file that is getting uploaded to those opps. I have my list of records Ids that I am passing to the apex but I am getting an error,
{message: &...
0
votes
1
answer
2k
views
Sort a list alphabetically
i have a multiselect picklist field Roles and i was trying to get the values in alphabetical order based on that(Roles) field.The method is as follows
public static List<opportunityRoles> ...
0
votes
0
answers
71
views
How do you initialize a list of feedItem on creation?
I've been having a hard time finding an answer to this question. How when you instantiate a list of FeedItem, do you manually initialize that list with more than one item at a time?
So far this is ...
0
votes
1
answer
497
views
Error:Method does not exist or incorrect signature: void add(List<Contact>) from the type List<List<GetContact.methodOutputs>>
I am trying to pass a firstname and lastname to an invocable method and get a list back of contacts filterd on firstname and lastname but get the error before saving my class:
Method does not exist ...
-1
votes
3
answers
327
views
Remove Duplicates in a list while adding up the other fields
I am trying to remove duplicate values in a list while adding up the other fields.
e.g.
my logic is → remove duplicates by (Name + role__c) and add the paid__c and hours__c values to the unique one.
...
-1
votes
2
answers
168
views
Extract data from string and reframe it into another
I have got a string in below format:
String test = '11, -22|32.45, 34|32, 41|32, 12.12';
I am trying to convert it into below format:
{"a":11,"b":-22|"a":32.45,"b&...
0
votes
2
answers
232
views
How to pass field of id from List to set
I have the following List from which I want to pass the UserId field into a set
string filter ='select UserId from OpportunityTeamMember';
List < sObject > filterList = database.query(...
1
vote
3
answers
1k
views
Technical Reason For Declaring A List with New vs. without New in Apex
What is the technical reasoning behind the two ways to declare a List? I know that new tells the compiler to create an instance of the List class, but what does the second one do differently? Also, ...
-1
votes
1
answer
286
views
Get object with specify id from list object in APEX [closed]
I have a list like following:
List<idName> = [idName:[name='AAA', id=1],
idName:[name='BBB', id=2],
idName:[name='CCC', id=3]]
And one input is equal 2;
So how can I ...
0
votes
1
answer
36
views
Duplicate in list
I am trying to update SObject record depending on the crtieria, id it matches create a SObject variable and adding values and then finally adding this into a List.When a match is found the Sobject ...
1
vote
1
answer
327
views
Can't parse JSON properly - access to inner list values
for two days, i am trying to figure out parsing of following json.
[
{
"name": "Czech Republic",
"alpha2Code": "CZ",
"...
0
votes
0
answers
525
views
APEX: How to find index of a list using partial text?
I have a very common requirement yet I am unable to find articles online. Requirement is - I want to find index (position) of an element in the list using partial text search for instance this code -
...
0
votes
2
answers
4k
views
Remove duplicate values in a list
Hello Im Trying to remove duplicate values in this table
The specific field is Sold_to_Broker_1_Commission_Rate_c, now my method is only returning the list with others parameters (more development), ...
0
votes
1
answer
313
views
How to insert a record and input values from the master/parent information
I have a custom object named "Property Booking" where if the status changed to approved
I have to create a record for my "Quotation" custom object. The tricky part here for me is I ...
0
votes
1
answer
350
views
Add Internal Email Distro to All Marketing Cloud sends
We have 40 distributed teams that send emails and they use multiple lists and DE's. How can my team be copied on every email we send through SFMC? Other email platforms allow for you to CC an ...
1
vote
1
answer
208
views
Create map from list and set where set value matches value in list
I have an apex class that is parsing json responses from a few apis.
The result is having a set and a list from the responses and I would like to map them together where the map key would be the value ...
0
votes
1
answer
1k
views
Populating Publication list using a Data extension, is that possible?
I have set up a Smart Capture form to handle subscription preferences, it just receives the subscriber information and stores it in a DE, there are 5 boolean attributes in the DE that correspond to 5 ...