Displaying Related Records In A Group Wise

<apex:page controller="groupwisedisplay" sidebar="false" title="Displaying Related Records In A Group Wise" showHeader="false">
 <!-- Begin Default Content REMOVE THIS -->
 <h1> Displaying Related Records In A Group Wise </h1>
 <apex:repeat value="{!StartHere}" var="gp">
 <apex:outputText style="color:blue;" value="{!gp.acc.Name}"/>
     <apex:repeat value="{!gp.con}" var="p">
      <li> (Contact) &nbsp;
       <apex:outputText style="color:green" value="{!p.FirstName}"/> &nbsp;
       <apex:outputText style="color:green;" value="{!p.LastName}"/>
    <ul >
     <li ><ol>
      (Case)<apex:repeat value="{!p.Cases}" var="child">
     <li >
      <apex:outputText style="color:gray;" value="{!child.Subject}"/>
 <apex:repeat value="{!gp.opp}" var="p">
 <li> (Opportunity) &nbsp;
 <apex:outputText style="color:red" value="{!p.Name}"/>
 <apex:outputLabel value="Close Date:" for="out1"/>
 <apex:outputText value="{!p.CloseDate}" id="out1"/> <br>
 <apex:outputLabel value="Stage:" for="out2"/>
 <apex:outputText value="{!p.StageName}" id="out2"/></br>


Apex Code/ Controller

public class groupwisedisplay {

public list<wrapgroupwise> singlegroup;
public List<wrapgroupwise> getStartHere(){
singlegroup= new List<wrapgroupwise>();
List<Account> tempacc=[select Id, Name from Account Limit 10];

for(Integer i=0; i<tempacc.size() ; i++){
list <contact> tempcon=[SELECT Id, FirstName, LastName,(SELECT Id, CaseNumber,Subject From Cases) From Contact Where AccountId =:tempacc[i].id Limit 10];
list <Opportunity> tempopp=[SELECT Id,Name,CloseDate,StageName From Opportunity Where AccountId =:tempacc[i].id Limit 10];
singlegroup.add( new wrapgroupwise(tempacc[i],tempcon,tempopp));

return singlegroup ;

 //wrapper class
 public class wrapgroupwise{
 public List<contact> con {get;set;}
 public Account acc {get;set;}
 public List<Opportunity> opp {get;set;}

 public wrapgroupwise( Account a , list<Contact> c,list<Opportunity> o){
 } //end of wrapper class

group wise displaying records


3 thoughts on “Displaying Related Records In A Group Wise

  1. I have tried after moving to c:\eclipse\ still while installing force.com plugging, I’m getting the following error
    Cannot complete the install because one or more required items could not be found.
    Software being installed: Force.com IDE (com.salesforce.ide.feature.feature.group
    Missing requirement: Force.com IDE (com.salesforce.ide.feature.feature.group requires ‘org.eclipse.update.ui 0.0.0’ but it could not be found

    Hay can you plz help me out.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s