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
MriduMridu 

How to include fields from multiple objects in apex:repeat.

How to include fields from multiple objects in apex:repeat..i want both PS(Payment_Schedule__c) ans RC's (Receipt__c) duedate..hw i will gt?please find a solution

<table width="100%" border="0" cellspacing="0">
   
    <tr style="font-size:14px; font-weight:bold;">
        <td>Particulars</td>
        <td>Receipt No</td>
        <td>Due Date</td>
        <td>Amount Due</td>
        <td>Amount Paid</td>
        </tr>
        <apex:repeat value="{!col}"  var="PS">
  <apex:repeat value="{!rec}" var="RC">
       <tr style="font-size:14px;">
       <td>{!PS.Name}</td>
       <td>{!RC.Name}</td>
       <td><apex:outputtext value="{0,date,dd-MMM-yyyy}">
       <apex:param value="{!PS.Due_Date__c}"/>
       </apex:outputtext>
      
       </td>
       <td><apex:outputtext value="{0,number,###,###,###,##0.00}">
       <apex:param value="{!PS.Total__c}"/>
       </apex:outputtext>
       </td>
       <td>{!PS.Amount_Received__c}</td>
      </tr>
 </apex:repeat>
   </apex:repeat>
    <br/>
    <tr style="font-size:14px;">
    <td width="40%">
    <apex:outputText style="font-size:12px;text-align:right;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</apex:outputText>
<apex:outputText style="font-size:12px;text-align:right;" value="{0,number,###,###,###,##0.00}">
   <apex:param value="{!Opportunity.Total_Scheduled_Amount_before__c}"/>
   </apex:outputText>
    </td>
    </tr>
    <tr style="font-size:14px;">
    <td>
    <apex:outputText style="font-size:12px;text-align:right;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Balance to be paid:</apex:outputText>
    </td>
    </tr>
   
    </table>
 
public class AccountStateDet {

    public List<Payment_Schedule__c> col{get;set;}
    
    public List<Receipt__c> rec{get;set;}
    public AccountStateDet(ApexPages.StandardController controller) {
        String oppId = Apexpages.CurrentPage().getParameters().get('id');
        col= [Select Name,Display_Order__c,Tentative_Due_Date__c,Installment_Value_in__c,Balance__c,Installment_Basic_Value__c,
                VAT__c,Service_Tax__c,Deposits_Other_Charges__c,Total__c,Due_Date__c,Opportunity__r.Name,Amount_Received__c 
                from Payment_Schedule__c where Opportunity__c =: oppId Order By Display_Order__c]; 
         rec=[Select Name,Amount__c,Receipt_Date__c from Receipt__c  where Opportunity__c =:oppId Order By Receipt_Date__c]
  
    }
    }



bob_buzzardbob_buzzard

You'll need a wrapper class for that - a custom class that encapsulates all the information.

 

There's a good post on this at:

 

http://wiki.developerforce.com/index.php/Wrapper_Class