You need to sign in to do that
Don't have an account?
Girbson Bijou 8
Extension Controller for a parent record return all the child in the Database
I have an Object Called Container__c with a child called Article__Container__c. I create a visualforce page to display all child with an Extension Controller. But when i Hit the button on the layout page it display all the child in the database not the ones related to the specific parent record.
//Extention Controller public class RgrReportControllerExt { public List<AggregateResult> allproduct{get;set;} public RgrReportControllerExt(ApexPages.StandardController controller) { allproduct = [ SELECT UM__c uom,SUM(Number__c)qtyReceived, SUM(Quantity__c)qtyPaking, SUM(PrimaryDiscrepency__c)Discrep FROM Articles_Containers__c GROUP BY UM__c ORDER BY UM__c limit 1000]; } } // portion of my VF Page <apex:page RenderAs="PDF" showHeader="false" sidebar="false" applyBodyTag="false" standardStylesheets="True" standardController="Container__c" Extensions="RgrReportControllerExt"> <b> Description of Goods</b> : <u>{!Container__c.Description__c}</u> <br/> (Descripción de bienes) <br/> <br/> <div class="firstBlock" > <div class ="SubfirstBlock"> <div> <table style="width:100%;border-collapse: collapse; border: 0.5px solid black;"> <tr > <th>UoM</th> <th>Expected</th> <th>Actual</th> <th>Descrepencies</th> </tr> <apex:repeat value="{!allproduct}" var="row"> <tr > <td>{!row['uom']}</td> <td>{!row['qtyPaking']}</td> <td>{!row['qtyReceived']}</td> <td>{!row['Discrep']}</td> </tr> </apex:repeat> </table> </div> </div> <div class ="SubfirstBlock"> <div> </div> </div> <div class ="SubfirstBlock"> <div> </div> </div> </div> </apex:page>
Best Answer chosen by Girbson Bijou 8
Raj Vakati
You are not passing the SOQL where condition to filter the child data like below ..update the code to filter the parent and child data