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
31 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 ...
0
votes
1answer
14 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
21 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
12 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
20 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
26 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
20 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
20 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
31 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
26 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
27 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
36 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
29 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
29 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
33 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
68 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
37 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
33 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&...
0
votes
1answer
149 views

Creating Utility Classes - Batching sObject list

My goal is to create a reusable and scalable utility class that can perform different DML operations. I'm aware of the 10,000 DML processed records limit so I'd like to check if the list is greater ...
0
votes
0answers
20 views

Does anybody know why some listID are numbers and others are alphanumeric?

I'm working whit MobilePush List. I run this query: SELECT SubscriberKey, Status FROM _ListSubscribers WHERE ListID = '7890d736-7f37-ea11-a2e9-1402ec938f98' and returned the following error: Query ...
0
votes
2answers
79 views

SOQL SORTING WITH 2 FIELDS

I have the object Animal__c, with the field ZooId. I want to make an SOQL Query with the animals sorted by CreatedDate DESC and Zoo Id. Now the list is: Animal 0 ZooId 5 CreatedDate Yesterday ...
1
vote
1answer
53 views

Explanation of an notation List<name.test> nameList

I have a piece of code as following: List<name.test> nameList In List is name a class or object. Why would we use such an annotation? Or for example: method(name.test variable)
1
vote
2answers
35 views

Select records from a List with a specific RecordTypeId

I have a List of the object Animal, with records from two different record types, How can I return another List with the animals with one of those record types?? Preferrably using a query instead ...
0
votes
0answers
17 views

AgentWork object

I am working with the AgentWork object, the thing is several AgentWork are being created with the same WorkItemId, when its status changes. My doubts are: First, I do not understand why several ...
0
votes
0answers
53 views

Break a list of id's to multiple list into equal number of records [duplicate]

I have created a list of id where i am adding record id of a custom object. List<Id> validProjectId = new List<Id>(); validProjectId.add(project.id); Now that this list has suppose 1000 ...
0
votes
1answer
31 views

Try Method in Debug Window

this is my first post, I don't speak english...ok. I will consume an API and I have this method: public without sharing class BP_ExpiredProductsCtr { public static id accID; public static void ...
0
votes
1answer
25 views

Hot to get value of relationship dynamic Soql

I am using the following string in a dynamic soql: SELECT id, name, orderdate__c, status__c, sold_To_Customer__r.id, sold_To_Customer__r.name, sold_To_Customer__r.customerreference__c, ...
0
votes
1answer
57 views

How do I check if a list-value from my Map is empty?

I get this error in case if Opportunity__c has no OpportunityInfo__c. I try to check it with the condition if(opportunitiesMap.get(actualTool.Rent__r.Opportunity__c).OpportunityInfo__r != null), but ...
1
vote
1answer
44 views

Is there a simple way to get the values of a list in a comma separated string all in once

I have a custom metadata type in which I want to add the API names of some custom fields to use the values in a Dynamic Soql. I used a list to get the values of the custom metadata fields. Is there a ...
0
votes
2answers
34 views

How and where can i use map along with list/set collection to get unique output

When I enter united states I need only one language. If I selected wrong language it want to throw an error. Map<String,String> countryMap = new Map<String,String>(); ...
0
votes
1answer
47 views

Trying to see if a Custom Field Value starts with any names from a Custom Metadata Type

I'm extremely new to APEX, but it seemed like this was a simple enough requirement. I have a custom field on the Account Record, and a list of 'bad codes' as a custom metadata setting. I need the ...
1
vote
1answer
24 views

Inserting dependent objects without using a loop

I have this issue. I have a list of Contracts and I need to create Cases and custom objects called 'Budget' that the Case needs to lookup. The code can be summarized to something like this for(...
0
votes
1answer
31 views

Transform Integer list into moving sum list

I have an Integer list, which has to be transformed into moving sum list: [ 1, 1, 1, 1, 1 ] => [ 1, 2, 3, 4, 5 ] [ 10, -10, 10, -10, 10 ] => [ 10, 0, 10, 0, 10 ] But I'm struggling, how to set ...
0
votes
1answer
46 views

How to set default value for List<Id> parameter and use it as argument

I have List as a parameter of the method but get the error when saving the class Error: Compile Error: Method does not exist or incorrect signature: void createEmailMessage(Id, OrgWideEmailAddress, ...
0
votes
1answer
44 views

How to avoid multiple soql queries?

I am working on something that requires insert, update and delete actions on Account object. I have written the below code but would like to know if there's a better way to do this by using maps ...
0
votes
0answers
49 views

Fix the logic for proper comparison using a Map

I'm trying to check and change the Client__c value in Mopping__c if the In_date__c has changed in the needed Rent__c. There is a lot of data, therefore Map is used. Structure: if Mopping 1 is related ...
0
votes
1answer
16 views

How to get a List Element of a Map

I have a map Map<Id, list<Boolean>> mapOfIdAndListBoolean = new Map<Id, list<Boolean>>(); I think I can get the whole list by using mapOfIdAndListBoolean .get(order.AccountId). ...
0
votes
0answers
19 views

MC stored Opt In Status from List into Data Extensions

The problem in our sales cloud/marketing cloud construct is that the opt-in must be stored in our marketing cloud and there is no field in the sales cloud for it. As I understand it from my research, ...
2
votes
2answers
47 views

SOQL - Best practise : what method choosing while retrieving datas?

There are multiple ways of let's say instanciate a list of contacts using SOQL ; My question is : is there a difference between each other, and is there a best practise ? Examples String name = '%a%'...
0
votes
2answers
39 views

Unable to access versionData from test class

I am facing an issue but I don't know what I'm doing wrong. I'm writing a test class for a code which has this 2 lines: public static Blob getPkpass(){ // more code here... List<...
0
votes
2answers
186 views

Add event listener for window resize in lightning web component

I want to ad an eventListener for window resize inside my custom lightning web component but I don't know how to do it Maybe something like this? constructor(){ window.addEventListener('resize', ...
1
vote
1answer
96 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
66 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
2 3 4 5
14