We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [iteration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
20 views

LWC: Iterate Map twice - Map<Integer, Map<String, String>>()

I broke my head with this case. Please help. APEX Map < Integer, Map < String, String >> reportData = new Map < Integer, Map < String, String >> (); return reportData; JS ...
2
votes
2answers
110 views

Iterating over wrapper class records lists in LWC

I have a LWC where i want to iterate over different lists of Opportunities in a wrapper. Currently im using: import { LightningElement,wire } from 'lwc'; import OppRecords from '@salesforce/apex/...
0
votes
1answer
34 views

Using aura:iteration over lightning:outputField doesn't seem to work

I'd like to display a list of configured fields (names possibly stored in CMDT) with lightning:recordViewForm, so it's easy to add/remove fields without deploying the component. However aura:...
0
votes
1answer
23 views

get a particular element in web component iteration

I want actually to be able to get an attribute on a particular item in the web component iteration, but cannot get it to work. Look for instance the following code : <template> <...
0
votes
1answer
23 views

Custom Iterators - calculating scope - batch

I am trying to understand the custom iterators topic Custom Iterators But there is a thing which I don't get. There is a next() method which divides the query size into smaller ones, am I right? In ...
0
votes
1answer
34 views

Is Filling a Map iterating on a list, deepcloning it and clearing a best practise?

I'm trying to fill a Map < Id, List< sObject>> by looping other the Map.keySet(), filling the list of sObjects, affecting it, and then go to the next key. I read somewhere that it was a good ...
0
votes
0answers
30 views

What is the best way to populate a map from a list conditionally?

I would like to know if there's a better way to populate a map from a list where conditions apply as to whether the list item is to be added to the map or not. For eg I have a list of objects ...
1
vote
2answers
496 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
0answers
25 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
31 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'...
0
votes
0answers
20 views

Update column value in a table whenever a value in row is changed

I'm populating column values using aura:iteration in a table and i want to change the column values whenever a row's(populated using aura:iteration as well) value input is changed. The problem is that ...
1
vote
2answers
236 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<...
0
votes
0answers
30 views

Incorrect index value being displayed on selection of radio button

I'm iterating over a list using aura:iteration. Each iteration I have a radio button where I have an attribute named data-index="{!index}". In the controller, when I try to print which radio button ...
1
vote
0answers
604 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
2answers
195 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
1answer
523 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 ...
2
votes
1answer
360 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 ...
1
vote
1answer
23 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'...
0
votes
1answer
24 views

How to make varaible of items in a iteration in a lightning component

I have an iteration which reproduces a list on a lightning page. I want to make this iteration variable based on 2 lists. How do I make the list (items) variable based on IF condition? Or do I need to ...
0
votes
1answer
140 views

iterating a multidimensional List

I am trying to recieve a email with an attachment (CSV FIle) and have it iterate through the csv and upsert it as records in a custom object. i upload the document by hand daily. PAIN! i am using a ...
0
votes
2answers
2k views

how to use wrapper class in batch iterator (using custom iterator)?

So I trying to use list of wrapper class as iterator in batch. below is the code I have tried so far Iterable class public class AccountCustomIterator implements Iterable<AccountWrapper>, ...
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 ...
4
votes
1answer
7k 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/...
1
vote
2answers
260 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 ...
4
votes
1answer
878 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 ...
0
votes
1answer
264 views

How to pass record id to another component while click on checkbox in aura iteration

I am facing one issue with navigating to record from another component when user selected checkbox in one component and I will get those selected Id in next component.
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 ...
1
vote
1answer
1k 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 ...
0
votes
0answers
120 views

Lightning iteration does not accept inputText values

I have the below markup in my Lightning component. <aura:attribute name="items" type="InventoryAdjustWrapper[]" description="Items" access="public" /> <!-- <aura:attribute name="items" ...
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. ...
1
vote
0answers
269 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 ...
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 ...
5
votes
2answers
238 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[]&...
0
votes
1answer
35 views

retrieve other fields of a SObject after a user has selected an option

I am writing an app that will help calculate the statute of limitations for certain laws. ex. enter a date that a crime happened on and, after choosing a law and appropriate limitation the limitation ...
4
votes
1answer
569 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 ...
1
vote
0answers
1k views

Using aura:iteration Table Sorting issues [closed]

I'm trying to use Sorting Datatable //cdn.datatables.net/1.10.12/css/jquery.dataTables.css and //cdn.datatables.net/1.10.12/js/jquery.dataTables.js in Salesforce Lightning Component. I've included ...
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 ...
6
votes
1answer
7k 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 ...
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 ...
1
vote
1answer
815 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
727 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 ...
0
votes
2answers
112 views

Comparing Two Objects then Modifying a collection 's elements

I am hoping someone can provide some direction. I have reviewed several postings regarding Modifying a Collection of Elements between Two Lists, however, I'm still coming up short on the solution. I ...
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 ...
1
vote
0answers
263 views

<aura:handler name=“change”> stops working after being called three times

I'm having an issue with a handler which initially fires as expected for three times, but then stops responding after that. The parent component has three attributes: A list of Custom SObjects A ...
0
votes
1answer
213 views

Daisy Chain Batch Jobs with External Variable

I'm trying to execute the same batch class for a series of dates and I want each batch to process after the previous one has completed. I'm not sure, from an architecture standpoint how to achieve ...
4
votes
1answer
883 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 ...
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 ...
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 ...
1
vote
0answers
217 views

Refresh subtab in Service Cloud or page in classical view using Visualforce

I've created a custom Visualforce page which is embedded into quick action (feed view). After user clicks submit button I'm changing the status of a case and trying to refresh the current subtab (...