You need to sign in to do that
Don't have an account?
SF_Monkey
iterate child records with aura:component
I am tring to load the child records with aura iterate. The records are loading from soql statement and the parent records are displayed; however, the child records will not load. It is a self-lookup relation with the object.
Any help would be appreciated
<section > <div > <div class="slds-modal__content slds-p-around_medium" > <lightning:accordion allowMultipleSectionsOpen="true" > <table class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer "> <div aura:id="conEditForm"> <thead> <tr class="slds-text-heading--small"> <th scope="col"><span class="slds-truncate">Name</span></th> <th scope="col"><span class="slds-truncate">Location Name</span></th> <th scope="col"><span class="slds-truncate">Login</span></th> <th scope="col"><span class="slds-truncate">Password</span></th> <th scope="col"><span class="slds-truncate" style="width:75px">Portal URL</span></th> <th scope="col"><span class="slds-truncate">Active</span></th> <th scope="col"><span class="slds-truncate">Monitored</span></th> <th scope="col"><span class="slds-truncate">Online Access</span></th> <th scope="col"><span class="slds-truncate">Last Download</span></th> <th scope="col"><span class="slds-truncate">Action</span></th> <th scope="col"><span class="slds-truncate">Record</span></th> </tr> </thead> <tbody > <aura:iteration items="{!v.data}" var="vend" indexVar="rowIndex"> <tr> <th scope="row" data-index="{!rowIndex}" onclick="{!c.toggle}" role="gridcell"> <lightning:accordionSection label="{!vend.Name}" /></th> <td><ui:outputText value="{!vend.Location_Name__c}"/></td> <td><ui:outputText value="{!vend.Login__c}"/></td> <td><ui:outputText value="{!vend.Password__c}"/></td> <td><ui:outputText value="{!vend.Portal_URL__c}"/> </td> <td><ui:outputCheckbox value="{!vend.Active_Account__c}"/></td> <td><ui:outputCheckbox value="{!vend.X180_Monitored__c}"/></td> <td><ui:outputCheckbox value="{!vend.Online_Access__c}"/></td> <td><ui:outputDate value="{!vend.Last_Download__c}"/></td> <td><button type="button" onclick="{!c.handleRowAction}" class="slds-button slds-button--neutral slds-float_center" id="{!vend.Id}">Add Child</button></td> <td><a href="{!'/one/one.app?#/sObject/'+ vend.Id + '/view'}"><ui:outputText value="Record Detail"/> </a></td> </tr> <!--Expanded section to display the child vendor invoices --> <aura:if isTrue="{!vend.expanded}"> <table class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer "> <thead> <tr class="slds-text-body_small "> <th scope="col" style="width:50px"><span class="slds-truncate">Account #</span></th> <th scope="col" style="width:75px"><span class="slds-truncate">Service Type</span></th> <th scope="col" style="width:75px"><span class="slds-truncate">Aggregate Benchmark</span></th> <th scope="col" style="width:75px"><span class="slds-truncate">Location Name</span></th> </tr> </thead> <aura:iteration items="{!vend.vendor_invoices__r}" var="chil"> <tbody> <tr> <th scope="row" ><ui:outputText value="{!chil.Name}"/></th> <td ><ui:outputText value="{!chil.Service_Type__c}"/></td> <td style="width:75px"><ui:outputCurrency value="{!chil.Aggregate_Benchmark__c}"/></td> <td style="width:75px"><ui:outputText value="{!chil.Location_Name__c}"/></td> </tr> </tbody> </aura:iteration> </table> </aura:if> </aura:iteration> </tbody> </div> </table> </lightning:accordion> </div> </div> </section>
Any help would be appreciated
Change this from to
and try, let me know if it works
for example, the below code is working
https://developer.salesforce.com/forums/?id=9060G000000XdAfQAK
Child Relationship Name: Vendor_Invoices
soql query:
The records are coming but only child records are not being displayed
@rameshDeepaish i have tried that and other variation of that but it is still not displaying those records