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

Trigger not working, not able to understand the concept of list map

I am building a trigger on an object called project board. so whenever a record is updated/inserted I want it to fire. It is linked to another object called project. So what I want is to count all the ...
2
votes
1answer
617 views

WSDL: getting the records from a child List<object> of a parent list in .NET

Is there a way to output a specific value in an list object of a list? I tried this but getting the range just returned int, so I can't actually returned an object. List<SaveResult> ...
-3
votes
1answer
404 views

I just want to display the values in picklist on VF Page

String soql = 'Select '+ pickField +' From '+ pickobjects; list<SObject> sObj = new list<SObject>(); sObj = Database.Query(soql); now i want to put the values of the list sObj into a ...
1
vote
1answer
488 views

Trouble Dealing With exacttarget List…without DE

We have a situation where get subscriberkey/email address from ET email and external site and i retrieve subscribers attributes IN THE LANDING PAGE (Hosted in the exacttarget) fields from the Exact-...
1
vote
1answer
758 views

Javascript to delete rows from a queue

I have javascript on my visualforce page that adds a delete button beside each new case added to the queue but cannot get this button to actually delete these items. This is the code I have so far. ...
3
votes
2answers
3k views

List Exception Duplicate id error

I get an error in my trigger when i tried to insert bulk data from data loader. Error is : ERROR: SubscriberUpdateTrigger: execution of AfterInsertcaused by: System.ListException: Duplicate id in ...
3
votes
3answers
6k views

Show Size of list visual force

This is my VF page: <apex:page standardController="Account"> <apex:relatedList list="Contacts" /> </apex:page> I would like to show number of records in the related list. I´ve ...
1
vote
1answer
89 views

Is it possible to add Object fields into a list

I want to add object fields into a list. The fields need to contain the data of a certain record. So suppose an Object X has 5 checkboxes. I want to add these 5 checkboxes to a list, BUT these ...
2
votes
3answers
5k views

how to number rows in a data table and how to get data from textbox

I have been searching through the net to see if I can figure out how to number rows in visualforce but I cannot find a way that will automatically increment when a row is added. I also cannot find out ...
4
votes
1answer
130 views

map with List as value in SOQL

I'm working on a small project where a customer can be the master in a master-detail relationship to more than a single project object. Projects have a currency 'Max_Budget__c' and what I want to do ...
6
votes
3answers
11k views

How to print ALL the elements of a List<>?

I would need to print all the elements of a list so to be able to copy them (CTRL+C) . In Debug Log , I can see only the first 10, or something similar . (a temp solution I'm using is to store them ...
1
vote
1answer
5k views

Displaying a list from a controller on a Visualforce page

I am trying to collect all of the cases that the user saves and display them in a queue at the top right of the page so they can tell which cases have already been completed. I have put a method ...
2
votes
1answer
16k views

Error “Initial term of field expression must be a concrete SObject: LIST” when fetching values from list

Can someone please help me here?I have the piece of code here alongwith the error I am facing. Apex class:Code snippet: Map<Id,Attachment> mapCaseAttachments = new Map<Id,attachment>(); ...
0
votes
1answer
88 views

Test Class to verify fields updated the same as the expected output

I'm creating my first test class got stuck with this one could you help me verify and correct the line of code for me. //Create a new record for Address Object with Local record type List&...
2
votes
3answers
8k views

apex repeat on multiple list values with one common id

I have 2 lists list<Attachment> and list<Calls__C>. The relation is Attachment.parentid=CAlls__c.Account__C. Now I want single repeat that will traverse through these two lists in ...
2
votes
2answers
116 views

list changes the column order of records while debugging

Apex: List<order_batch__c> bcList = new List<order_batch__c>(); bcList= [select Or_sub_po_number__c,Or_customer_PO_Number__c, Or_customerid__c,Or_Account_name__c,...
1
vote
1answer
146 views

Send list in HTTP Request in particular order taking order by as row num?

Apex code: List<order_batch__c> bcList = new List<order_batch__c>(); bcList= [select Order_numbering__c,Or_clientpn__c,Or_customerid__c,Or_customer_PO_Number__c,...
0
votes
1answer
31 views

List is not generated in trigger

While I insert data through data loader and check this debug.Debug log generates only one value for clientIds.So, I am getting only value for objList though I am inserting multiple records for custom ...
2
votes
0answers
48 views

How to create a persistent list of modified SObjects for later sync to 3rd party system?

Over the course of a 24 hour period, I need to keep some sort of persistent list of contacts that have been updated under certain conditions. I'll populate the list with a trigger that evaluates the ...
2
votes
1answer
432 views

Without Data Extension ? Possibilities in Exacttarget

We do have a form LP and its URL is situated in External webpage .We use the Form LP's to capture the leads in Exact-target. We don't have DE enable to our account and ET says and i quote "Data ...
4
votes
4answers
2k views

Trying to get a SOQL query with no duplicates

EDIT: Is there a way where I could just loop through my list and remove the duplicates? It should be easy but I've been having trouble with it. I have tried a bunch of different methods of getting ...
0
votes
2answers
103 views

Inserting test data using a list or a map to reduce the number of DMLs and get different Ids for different tests

Refer to below test class, @isTest public with sharing class CategoryHelperTest { private static boolean testDataCreated = false; private static Scheme__c ss; private static ...
3
votes
2answers
4k views

Collection of List<sObjects> keyed by sObject field

Is it possible to have a Map (or other collection) of sObjects list, keyed by one lookup field of the same sObject. Something like Maps of sObjects (below code doesn't works): Map<Id, List<...
2
votes
1answer
172 views

How to Use Custom Subscriber Attributes in a Triggered Email

I am using a Microsite to hold a page which allows users to generate a PDF, and then either download it, view it, or email it to someone else. I have generated the PDF successfully, but I'm having ...
0
votes
1answer
68 views

Inserting test data using a list to reduce the number of DMLs

I got the below test class, @isTest public with sharing class CategoryHelperTest { private static boolean testDataCreated = false; private static Scheme__c ss; private static ...
2
votes
1answer
754 views

Problem with creating Lists for Standard Task Object

"List controllers are not supported for Task" I've been struggling with this for quite some time now. If I want to create and display a Task list (atm i'm trying to do it with a table, which already ...
1
vote
3answers
1k views

How can we create temporary list for send SMS?

We need to send SMS to a different audience every day. We have created an import definition with mobile connect, and have used in automation studio with an Import Mobile contact activity. We have ...
3
votes
2answers
3k views

Why can´t we import Mobileconnect SMS contacts from data extension in automation studio?

We have created a "contacts" data extension. Have three fileds, an ID (subscriber key), mobile number and locale. We need to import these contacts to use them in SMS in automation studio. To do this, ...
4
votes
4answers
2k views

SOSL Queries returning empty lists

When you do a SOSL query - the result is in the form of multiple lists (one for each object you search). List<List<sObject>> resultsList = [FIND 'test' IN NAME FIELDS RETURNING ...
5
votes
1answer
514 views

Advice on a trigger that wont work

My colleagues need to create a number of quotations on an opportunity, send them out and then when the customer comes back with their decided quote, the quote needs to be synced to the opportunity ...
2
votes
2answers
78 views

Is it possible to use SOQL to query a list that was created in a trigger

Does a SOQL query have to access the database, or can it be used to search through a list (or map)? I think lists are easier to visualize, so I would have made a list in a FOR loop for each object ...
1
vote
1answer
5k views

Get one value from a list as an integer

I am having trouble updating a variable because of various errors. I cannot get the value from my list to work with the value of my other list. trigger StudentNoUpdate on Class_Size__c (before insert,...
0
votes
1answer
227 views

List index out of bounds: 0

I get error when LargestRevision list has null revision numbers. Here revision number is a number field and Quote_Link__c is a lookup. if(quoteLink.Id!=null) { LargestRevision =[...
2
votes
1answer
1k views

passing a param in a dataList and commandLink

Okay so here is my visualforce page <apex:page standardController="Account" extensions="RelationshipTreeController"> <apex:form > <apex:dataList value="{!relationships}" ...
1
vote
2answers
144 views

SOQL error index out of bound : 0

I get this error if LargestRevision returns null. ie., fields revision and quote link have no values. Why isn't the else part handling null values? Following is the code I tried. if(quoteLink....
2
votes
1answer
152 views

Create vote/survey SMS without audience

We have created a multi-step SMS with vote/survey SMS using MobileConnect. When we created a vote/survey SMS, it´s required an audience.list. When we done it, we recieved the SMS at send. But these ...
4
votes
1answer
951 views

Visualforce list using Apex function and parameter

So at the moment I have a VisualForce Page that uses the following code: <apex:page standardController="Contact" extensions="RelationshipTreeController"> <apex:repeat value="{!...
4
votes
0answers
2k views

Subscripting a list in VisualForce

I have a list of items, and I'd like to access the first item like below, but get an error when I compile: <apex:outputText value="{!items[0]}" /> Incorrect parameter type for subscript. ...
11
votes
4answers
7k views

How to detect first or last iteration of apex:repeat

I currently have some VisualForce which uses an <apex:repeat/> element and inserts commas in between the items like so: <apex:variable var="idx" value="{!0}"/> <apex:repeat value="{!...
4
votes
1answer
166 views

Visualforce: Can't call sort method on List of Comparable objects

I have a list of custom objects whose class "implements Comparable". In my visualforce page I have {!thelist.sort} as an action for a command link. I get an error: action="#{thelist.sort}": Unknown ...
0
votes
1answer
2k views

Batch Apex and Lists

I have batch class that I'm using to add Contacts to a Campaign. I could have up to 6000 contacts I need to add at one time. I'm calling the batch from another controller class. Question is for ...
1
vote
4answers
154 views

Trigger - Collection - List Question

I'm working on this trigger: trigger ActivityCostInvitees on Event (after update){ List<EventRelation> whoRelations = [SELECT Id, Relation.Name, Status ...
0
votes
2answers
1k views

Save error: Loop variable must be of type LIST<String>

i am getting an error given below while i trying to iterate a List of String lists. I am thinking that i missed something very simple but did not able to move beyond this issue. Please clarify. ...
0
votes
1answer
523 views

Custom object tab list fields do not link to object detail

Hey guys, I hope I'm not asking this question twice - I though I asked earlier, but now that I look at my profile, I don't see it. Anyhow, I created a custom object. On the custom tab, when I pull a ...
0
votes
1answer
698 views

What's the order of the records after calling getall() method on a custom setting?

I've got a getall().values() on a custom setting, but the values retrieved doesn't seem to be ordered by the record's name. Why? Do I have to use only the getall() and then run a loop and order it?
1
vote
2answers
178 views

What is the best approach (shorthand form) to iterate a collection of List with varying size?

I have a collection of list which is, List<List<String>> Now, i am iterating it as follows, for(List<List<String>> n: mapSAP.values()) { for(List<...
1
vote
1answer
574 views

Problem Setting Id variable - List has no rows for assignment

Not sure if I'm doing something incorrectly, but I'm having an odd issue. Below is a sample of my code which works fine in an execute anonymous window, but errors when I try to run it in a test class. ...
5
votes
3answers
1k views

Dynamic Apex Question

I am trying to extend a apex metadata coding example for retrieving the record types for all objects in my org. I know this is basic but I am working my way through coding examples for my 501 ...
2
votes
2answers
5k views

How to toggle between ascending and descending in List.sort() of custom type?

i have a code which is always sorting in ascending order. i need to do it descending based on the input. I have followed the previous post How to sort Wrapper list?'s code snippet). Here is my code, ...
1
vote
1answer
817 views

What sorting algorithm does List.sort() using to sort the list of custom type?

i am wondering what sorting algorithm does List.sort() is based upon. When i try to sort the following order and have written a debug statement inside the compareTo method it gives the following ...

1
10 11 12 13
14