function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SimrinSimrin 

Display child record of Master detail relationship

@AuraEnabled
    public static List<Mandrake__Blog__c> getExpenses() {

        return [SELECT id, (select Mandrake__comment__c FROM Comments__r)
                    ,Mandrake__Contents__c
                    ,Mandrake__Group__c
                    ,Mandrake__Title__c
                FROM 
                    Mandrake__Blog__c 
                ORDER BY 
                    createdDate ASC
               ];
    }
<aura:attribute name="expense" type="Mandrake.Expense__c" />

                <div class="recordItem">
                <aura:iteration items="{!v.expense.Comments__r}" var="Comment">
                    <ui:outputText value="{!Comment.Mandrake__Comment__c}"/>
                </aura:iteration>
            </div>

Hello,

I am trying to display child records.
I have no errors but no dispaly as well.

How can i debug the issue 
Best Answer chosen by Simrin
RishavRishav
Hii Simrin,
You have declared the varibale of type "Expense__c" but you are querying data from "Blog__c" in apex . This is wrong.
you are not getting any data because your variable of type "Expense__c" is not getting any value from controller.

Please correct your SOQL query. 

Thanks
Rishav