Questions tagged [iteration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

How to get the current index of iteration in JS file LWC

Is there any way to get the current index of iteration on array of objects. <template for:each={prWrap.listOccu} for:item="occu" for:index="occIndex"> </template>
0
votes
0answers
23 views

Number of iterations exceeded - Only iterating through 250 records

I have a simple flow that pulls in all active employees and checks 1 field within the Contact record. In a loop there is a decision element and then 2 assignment elements. The flow fails after ...
0
votes
1answer
20 views

LWC Nested Iteration Issue

I am facing an issue with the nested iteration, Suppose I have one button in child loop and i want index of parent and child loop both in onclick function of JS file. I am only getting index of child ...
0
votes
1answer
27 views

Mirroring of single picklist value in all picklists in nested aura iteraton

I have used an aura iteration to create a table and I have a picklist field inside that table which uses an aura iteration itself. The problem here is that whenever I select the value of any one of ...
0
votes
0answers
39 views

Creation of dynamic rowspan in an HTML table

I have a component that shows me records and I use "aura:iteration" to create the table rows, but if those records are the same family or category, I end up bringing them together, because ...
1
vote
2answers
61 views

LWC for:each needs 3 levels, but SOQL query aggregate relationship limited to 2. What's your best practice?

so I have a structure like: <template for:each={containers.data} for:item='container'> <....> //container info <template for:each={container.Pallets__r} for:item="pallet"&...
0
votes
0answers
78 views

Iteration in LWC not working for 2nd element of input array

I am working in LWC requirements where I have a list of records using this list I need to create inputs text. Once I loop through the list in LWC 'HTML component' my input texts are coming as aspected ...
0
votes
1answer
167 views

LWC create input fields under LWC iteration

I am new to LWC. I have to create multiple input fields for different rows. Let say, I have selected 3 records from the previous page and for all those 3 records I need to create the input field and ...
0
votes
1answer
43 views

Bulk Apex iterator not working with aggregate query

I am at a bit of a loss at how to properly structure a batch apex query with an iterator in order to utilize batch apex with an aggregate query. This is my current code Iterator global class ...
0
votes
1answer
32 views

capture value from drowndown in iteration

Newbie in SFA development, however I have experienced in ASP.NET (C#) development. I have a question regarding this output: the NAME COLUMN is list of PRODUCT populated from the Salesforce Object. ...
0
votes
1answer
50 views

Error handling for iterable child component inside parent in lightning web components (LWC)

In my parent component , I have used child component inside and iteration. So for example child component is present twice in parent component. Now I want to show error message when on of the required ...
3
votes
1answer
421 views

How to use 'lightning-checkbox-group' in for:each loop?

Currently, my requirement is that I want a checkbox in front of names.You can see below screenshot. So I used lightning-checkbox-group in iteration but it does not work. Here is the Playground Link ...
3
votes
2answers
3k views

Expressions in for:each index value in LWC? [duplicate]

Currently, I am facing an issue is that I want index starting from value "1" I am using for:each in my code. <template> <lightning-card title="HelloForEach" icon-name="custom:custom14"&...
0
votes
1answer
1k 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
840 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
157 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
47 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
36 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
40 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
48 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 ...
2
votes
2answers
2k 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
54 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
38 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
2answers
394 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
0answers
1k 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
32 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
375 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
793 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
510 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
32 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
28 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
239 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
3k 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
7k 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
10k 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
461 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
976 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
326 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
3k 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
2k 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
137 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
4k 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
271 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
27 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
244 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
631 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
5k 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
8k 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 ...