Questions tagged [iteration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
1k 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 ...
gs650x's user avatar
  • 2,600
2 votes
1 answer
785 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 ...
ryguy's user avatar
  • 23
1 vote
1 answer
53 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'...
Michele Kleinhomer's user avatar
0 votes
1 answer
75 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 ...
Thomas's user avatar
  • 2,294
0 votes
1 answer
528 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 ...
Bryan's user avatar
  • 89
0 votes
2 answers
6k 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>, ...
Ratan Paul's user avatar
  • 22.5k
0 votes
1 answer
9k 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 ...
Uwe Heim's user avatar
  • 28.3k
4 votes
1 answer
13k 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/...
Nebbyyy's user avatar
  • 838
1 vote
2 answers
943 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 ...
jaw999's user avatar
  • 1,308
4 votes
1 answer
1k 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 ...
EricSSH's user avatar
  • 4,324
0 votes
1 answer
462 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.
Sayanton Sadhu's user avatar
4 votes
1 answer
6k 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 ...
SfdcBat's user avatar
  • 4,751
1 vote
1 answer
3k 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 ...
Patrick's user avatar
  • 11
0 votes
0 answers
149 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" ...
Pasan Eeriyagama's user avatar
3 votes
3 answers
10k 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. ...
Derek F's user avatar
  • 59.3k
1 vote
0 answers
278 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 ...
Olsthoorn's user avatar
  • 110
2 votes
1 answer
36 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 ...
Carlos Naranjo's user avatar
5 votes
2 answers
315 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[]&...
Olivia's user avatar
  • 3,431
0 votes
1 answer
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 ...
mason dyess's user avatar
4 votes
1 answer
798 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 ...
CarnVanBeck's user avatar
1 vote
0 answers
2k 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 ...
user10286's user avatar
  • 422
1 vote
2 answers
9k 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 ...
yeselkay's user avatar
  • 321
8 votes
1 answer
9k 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 ...
Sarang's user avatar
  • 2,560
3 votes
1 answer
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 ...
DanHam's user avatar
  • 155
1 vote
1 answer
1k 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 ...
col_powers's user avatar
1 vote
2 answers
866 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 ...
nicstella's user avatar
  • 589
0 votes
2 answers
539 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 ...
tomc0920's user avatar
3 votes
0 answers
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 ...
Simonp's user avatar
  • 1,892
1 vote
0 answers
332 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 ...
Bigears's user avatar
  • 1,091
0 votes
1 answer
669 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 ...
Todd Sprinkel's user avatar
4 votes
1 answer
1k 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 ...
Salim Mohamed's user avatar
11 votes
2 answers
13k 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 ...
Sharan Desai's user avatar
2 votes
2 answers
3k 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 ...
Angelo's user avatar
  • 317
1 vote
0 answers
253 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 (...
NGix's user avatar
  • 889
1 vote
2 answers
574 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="{ ...
bafuda's user avatar
  • 757
1 vote
2 answers
1k 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 ...
Christian Menzinger's user avatar
0 votes
1 answer
3k views

How to fetch the value inside a list item(not having an id since created dynamically) in lightning?

I am creating a a list using aura:iteration: <aura:iteration var="pf" items="{!v.family}" indexVar="ind"> <li class="slds-dropdown__item"> <a href="javascript:void(0);" role="...
Ayan Sengupta's user avatar
2 votes
1 answer
1k 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 ...
jscho's user avatar
  • 23
0 votes
3 answers
2k views

Modify collection during iteration

I have below code where I need to modify the List during iteration. It throws error. can someone suggest a way out in this case? **Error ** System.FinalException: Cannot modify a collection while it ...
Testing_SFDC's user avatar
  • 2,940
3 votes
2 answers
571 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 ...
vishal's user avatar
  • 151
1 vote
1 answer
691 views

<aura:iteration> How to properly add commas on fields

I have an aura iteration using dynamic fields in this code snippet. <aura:iteration items="{!v.qResults}" var="q"> <li id="{!q.Id}" class="slds-dropdown__item" role="menuitem ...
nyor's user avatar
  • 55
3 votes
1 answer
1k 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&...
SfdcBat's user avatar
  • 4,751
1 vote
1 answer
22k views

Copy a list to another list

I have a custom object called skill_Review and I am creating a list in my controller using: List<Skill_Review__c> skillRev = new List<Skill_Review__c> List<Skill_Review__c> ...
SfdcBat's user avatar
  • 4,751
2 votes
1 answer
182 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 ...
tarun's user avatar
  • 23
2 votes
3 answers
2k 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 ...
Avinash's user avatar
  • 2,081
3 votes
2 answers
2k 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 ...
Nic McBride's user avatar
0 votes
1 answer
693 views

Aura iteration too show value in two columns [closed]

i need to show in two grids how to use aura iteration to do it. suppose list is like ab,cd,ef,gh,ij,kl,mn then the ui should values like ab cd ef gh ij kl mn please suggest if you ...
Anand singh's user avatar
9 votes
1 answer
16k 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",...
Justin's user avatar
  • 337
1 vote
1 answer
511 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 ...
dzh's user avatar
  • 4,016
9 votes
2 answers
1k 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 ...
Greg Grinberg's user avatar