Questions tagged [iteration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
10
votes
2answers
9k views

How to iterate a Map in Aura

I have a aura map attribute defined in my component file as below <aura:attribute name="FilesNameMap" type="Map"> But i am not able to understand how to iterate this in the component file as ...
9
votes
1answer
13k views

Nested aura:iteration to dynamically get fields

I am trying to dynamically create a data table with two arrays (SObject array and a String array which has field API name). The two arrays are Contact[] and String[], where String[] consists of ["Id",...
9
votes
4answers
7k views

How to use <force:inputField> and <force:outputField> inside an <aura:iteration>

Here @Peter describes a very cool way to use a <force:inputField ... /> together with <aura:attribute name="YourObjectType" type="YourObjectType" default="{ sobjectType: '...
8
votes
2answers
474 views

Why aren't iterators in batch jobs lazy-loaded?

I have a batch job that needs to callout to an external web service and retrieve a variable number of records. Seems like a perfect use-case to have an iterator which performs the callouts until there ...
8
votes
1answer
5k views

Stop Batch Process

Good day everyone, I have created a batch process. Let say I have thousands of records to process. Now what i want is when there is an error encounter or some problem found in the data during the ...
6
votes
1answer
6k views

How to implement on scroll action in lightning to show next few list of records

I want to render many(about 1000) components and I am displaying them through aura:iteration in another aura:iteration. This is causing me performance issues. I want to display only 10 records at an ...
6
votes
1answer
3k views

Why is my Lightning aura:iterate component not iterating?

Currently working through the Create a Standalone Lightning App tutorial, which seems a good introduction to SFDC Lightning, but not entirely flawless. I have this component <aura:component ...
5
votes
2answers
233 views

Looping Through A Map

I have a map I want to loop through and remove all duplicate items. Is there a method that can be used like my pseudo code has? public Map<String, User[]> allPeople { Map<String, User[]&...
4
votes
1answer
843 views

Lightning Aura Iteration ReRender

I am trying to rerender an iteration(wrapper) when an input field is changed although I am extremely unfamiliar with Lightning. Everything that I've read it "it should just work", which I don't ...
4
votes
1answer
6k views

Inserting Records using a lightning component

I am looking to make a lightning component to insert my Transaction__c object records against all relevant Contracts pulled back requiring action. As it stands I am returning all of relevant contracts/...
4
votes
1answer
2k views

How Custom Iterators with Iterable Work

I was reading the topic of using iterator and iterabel Interface - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_iterable.htm It says : If you do not want ...
4
votes
1answer
870 views

Lightning Component - data binding not working on sObject [] for new element pushed in array

If I load a sObject array in init function, I m getting my array correctly filled and loaded to the UI using iteration. I create a new button to add (push) new element of the same type to the existing ...
4
votes
1answer
335 views

How to get Map collection out of a list?

I currently have a multi-demensional map/list object that is defined like this: Map <Id,List <Map <Id,Custom_Inventory__c> >> complexMap = getComplexMapObject(); The object was ...
4
votes
1answer
4k views

Number of iterations exceeded - Flow Error

I have a flow that loops through Opportunity Line Items. When the number of line items get large it get an error in my flow. The UI gives the following message "You or your organization has exceeded ...
4
votes
1answer
548 views

aura:iteration index is empty

I'm trying to conditionally format my items in a Winter'17 Org based on a selected index. But comparing the iteration index to my selected index (v.Active) doesn't work. I tried to output it and it ...
3
votes
3answers
3k views

Adding/removing elements from a `Map` while iterating over it

Background I'm working on a bugfix for some code that I've written. The code itself generally works fine (bugfix is for an edge case), and the exact code isn't terribly important for this question. ...
3
votes
1answer
277 views

Using next method in iterator

In my code below: List<Skill__c> skilist = [ select Id,Name from Skill__c where Skill__c.Id IN:sl.keySet()]; Iterator<Skill__c> iter = skilist.iterator(); List<Job_Opening_Skill__c&...
3
votes
2answers
161 views

How can I filter through object using 2 separate fields as unique identifiers?

I have a custom object (we'll call it RS__c), and it theoretically has a 1 to 1 relationship to OpportunityLineItems (it is not possible to create a reference field directly to create this ...
3
votes
1answer
2k views

Unable to display custom object list attribute returned from client side controller

I am hung up on the hands-on challenge for the Lightning Component Basics > Input Data Using Forms section on Trailhead. I have a form with input controls for name, quantity, price, and isPacked ...
3
votes
2answers
331 views

Pagination Using Iterator Limit

I have to paginate total of 4000-5000 records with 20 records per page. I am using a wrapper class type List. This list would be displayed on a pageblocktable. I CANT use OFFSET because offset has a ...
3
votes
1answer
430 views

This map cannot be used in an iteration because the keys cannot be sorted

In my apex code I am adding some value into map. And I am trying to loop through the map on VF page using apex:repeat but I am getting an error that This map cannot be used in an iteration because ...
2
votes
1answer
5k views

Lightning Components: How to do nested aura:iteration of a list of Accounts with subselected Contacts?

Scenario In Visualforce we had strong patterns for implementing the rendering of hierarchical structures. As a simplified example (standing for many other use cases) let's say we want to show all ...
2
votes
2answers
2k views

Is there a Salesforce solution to Filter or Limit Aura iteration?

I am iterating through a list of items as follows <aura:iteration items="{!v.objWrap}" var="item" indexVar="idx"> ... ... ... </aura:iteration> I also want to have a load more button ...
2
votes
1answer
318 views

Iterate related records, display images from string name of contentAsset in Community Cloud

I'm very new to Salesforce, so my apologies if my approach is all wrong. I want to display a list of buttons with images using a lightening component in Community Cloud. The list comes from records ...
2
votes
1answer
551 views

Batch Job with Custom Iterable throwing error First error: Invalid conversion from runtime type CustomIterable to System.Iterable

I get the error First error: Invalid conversion from runtime type CustomIterable to System.Iterable when trying to use a customer iterable in a batch job. My custom iterable class: global class ...
2
votes
1answer
26 views

How to check values from child object

I was wondering what would be the most efficient way to do the following. The Account object is the parent of the Order object. The Order object has a field called 'Status'. The Status field, a ...
2
votes
1answer
128 views

Updates from nested apex repeat in Visualforce not being posted to server correctly

I am having a custom object where there is a list within a list within a list. On the Visualforce page I am presenting it using an apex:repeat and apex:inputText fields. When I try to change and ...
2
votes
3answers
926 views

Iterate over queried lookup fields

Example: Opportunity Opp = [SELECT Name, Status__c, Zone__c, Invoice__r.Amount__c, Invoice__r.Date__c FROM Opportunity WHERE ID ='006a12nlfoenlew']; I need to iterate over each field and see if the ...
2
votes
2answers
1k views

Iterating inside a Map

Big picture, upon importing a csv, we have some unique Id's that may be tied to an account already in our instance. I can iterate over a list with no issue and to find any unique Id's with a matching ...
2
votes
0answers
2k views

ui:inputCheckbox and aura:iteration: value binding

I am currently writing a lightning component made of a table of elements that can be selected (or not) using a ui:inputCheckbox. So the way I do is fetching the data from APEX controller during the ...
2
votes
0answers
428 views

Get first row of CSV data in salesforce and use for mapping

I want to get data from csv and upload it to salesforce. I use this link http://www.blueengine.com.au/?p=40#comment-271 and http://developer.financialforce.com/customizations/importing-large-csv-...
1
vote
2answers
236 views

LWC: detect last element in for:each iteration

I'm trying to output a list of strings separated by commas in LWC, such as: cat, dog, mouse I need to use template for:each and output a list item and a comma, but only if the item is not the last ...
1
vote
2answers
213 views

Exception not being caught; System.FinalException: Cannot modify a collection while it is being iterated

Why is this Exception not being caught? I read that System.LimitException is not caught but didn't see anywhere about System.FinalException. Non-Working Code @AuraEnabled public static List<...
1
vote
1answer
766 views

Aura:Iteration Tag Not Working

I am trying to display information from the users object, but I cannot get the components to cooperate. Code is below: apex: public with sharing class LACC_ObjController { @AuraEnabled public ...
1
vote
2answers
718 views

Aura :iteration and :if, WARNING: Performance degradation..

I'm receiving a WARNING: Performance degradation: Multiple items were set in iteration message. This occurs in the code below when the aura:if element is there, but not when it isn't. Each group ...
1
vote
1answer
22 views

List iteration - item with space

I am trying to create a very basic static list to iterate through. One of the values has a space in it. I can't figure out how to add the item to the list with a space. In the example below, I can'...
1
vote
2answers
175 views

Passing List<WrapperClass> as a parameter from Visualforce to Lightning and to iterate over the List<WrapperClass>

This is my VF code, which runs on onclick <script> function func(data) { $Lightning.use("c:testingFromVFtoLightningApp", function(){ $Lightning.createComponent("c:...
1
vote
2answers
3k views

Sorting a List<Asset> by a date

I have fetched assets sorted by date using SOQL query. When I do for(Asset a:lstAsset) and add a to a list, the sort order from the SOQL query is lost. I want the sort order to be retained. Is there ...
1
vote
2answers
501 views

Error when aura iteration given list property

I'm getting an error when I supply the list property acc.Contacts to the aura iteration component. <aura:application> <aura:attribute name="acc" type="Account" default="{ ...
1
vote
2answers
978 views

text property of ui:inputSelectOption with aura:iteration not working correctly

My understanding of the text-property from the ui:inputSelectOption is that I can add underlaying data (in difference to the label-property which displays the data on the GUI-Interface). In my opinion ...
1
vote
1answer
430 views

How to iterate sub query on lightning page

I want to display the contact names and opportunity names where AccountID is not null, I am able to display the contact names, can someone please help me to display the opportunity names too? Below ...
1
vote
2answers
222 views

Add records incrementing based on known Date

I expect this has been described before but have been unable to find it. I am entering OpportunityLineItemSchedule in Apex and would like wipe out the default ones, which are created based on Close ...
1
vote
1answer
947 views

How to display a specific list in a component lightning?

I have a JSON and I parse it. Finally I this is my class for parsing the JSON : public class InterlocuteursParser { public class Interlocuteurs { public String contact; public ...
1
vote
1answer
314 views

Is aura:iteration reactive?

Say I have multiple components nested under each other, one takes collection of Accounts, the component under Account takes a collection of Contacts. Say I want to programmatically remove one of the ...
1
vote
1answer
2k views

Get Data from batch iterable

Good day everyone, Maybe this question is basic for everyone but I'm having a problem with it, so I'm asking for help. I have created a BATCH ITERABLE . global with sharing class batchProcessor ...
1
vote
0answers
23 views

aura:iteration label of current field

Is there a possibility to get the Label of current field using aura:iteration ? <aura:iteration items="{!v.objectName}" var="objectName"> <lightning:input value="{!objectName.field1}" ...
1
vote
1answer
28 views

How to Implement “fluent constructors” inside visualforce page data iterator?

I am trying to put together a custom controller class implementing the fluid interface builder pattern. Said class does compile, and my question is how can it be implemented inside a VisualForce page'...
1
vote
0answers
490 views

Lightning button attribute “Disabled” in “aura:iteration tag”

I'm trying to enable a lightning:button if a lightning:inputField changes. This is the aura:component: <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:...
1
vote
0answers
28 views

how to check iterator in batch process

I am using an iterator to use an aggregate query on a custom object looking for unique years. on the very last iteration, I want to change a value, so I am hoping to use hasNext, but it looks like i ...
1
vote
0answers
268 views

How do i access components made through iteration without using aura:id?

I am currently developing a search bar for Salesforce Lightning and i am having a bit of trouble with editing the class of dynamically created components using aura:iteration. At the moment i use ...