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
Mathieu CanyMathieu Cany 

Display table and details group by ownerId



Ive created a view like this one (

As you can see I display all opportunity and there are group by Account Name (A bank In my case).

I'm using the following code for display these informations. (



Now I would like to display all my opportunity grouped by another type, nor more related to Account. I would like to group them by Opportunity Owner.  The following sreenshot show that my code doesn't send any information. (


My controller :



            public class opportunityTotal {
         public Opportunity opportos { get; set; }
         public list <Opportunity> opporto { get; set; }
         public Opportunity total { get; private set; }
         public Opportunity totalparemploye { get; private set; }
         public Opportunity totalparemployepercue { get; private set; }
         public Opportunity account { get; private set; }
         public Opportunity orr { get; set; }
       public opportunityTotal(Opportunity orr) 
    total = new Opportunity(Amount__c = 0);
    totalparemploye = new Opportunity(Commission_to_Sextant__c = 0);
    totalparemployepercue = new Opportunity(Commission_to_Sextant__c = 0); 
    if(orr.Amount__c != null){
        totalparemploye.Commission_to_Sextant__c += orr.Commision_owner_1__c + orr.Amount_commision_2__c + orr.Commission_1_Bis__c;
    totalparemployepercue.Commission_to_Sextant__c += orr.Commission_owner_percue__c;

     public List<OpportunityTotal> getnouvellevueparemploye() {
        List<OpportunityTotal> nouvellevueparemploye = new List<OpportunityTotal>();
        for(Opportunity orr:[select name,Amount,Amount__c, OwnerId, Owner.FirstName, Owner.LastName, Classer_le_dossier_dans_les_historiques__c, LeadSource, Commission_to_Sextant__c, Commision_owner_1__c,	Completion_fees__c,
        							Commission_1_Bis__c, Commission_1_Bis_Paid__c, 	Commission_1_paid_to_owner__c, 	Payed__c, Commision_owner_2__c, Commision_Lead_source__c, 	Amount_charged__c, Amount_commision_2__c, Amount_commision_to_source__c, 	Fee_Paid__c, 	Completion_fee_paid__c,
        							Chiffre_d_affaire_du_dossier__c, CA_realise_du_dossier__c, 	Benefice_du_dossier__c, Befefice_du_dossier_realise__c, StageName, Commission_owner_percue__c
                from Opportunity

        /*   --------1.11------------------------------- AJOUT DES RESULTATS SUR LA 2.00 ------------------1.11---------*/
            nouvellevueparemploye.add(new OpportunityTotal(orr));
        /*   --------1.12------------------------------ RETOUR VERS LIST AVEC EN PARAMETRE LA REQUETE ------------------1.12---------*/
        return sortOpportunityTotals(nouvellevueparemploye);
private List<OpportunityTotal> sortOpportunityTotals(List<OpportunityTotal> totals) {
        List<OpportunityTotal> returnList = new List<OpportunityTotal>();
        Map<Decimal, List<OpportunityTotal>> totalMap = new Map<Decimal, List<OpportunityTotal>>();
        for(OpportunityTotal t:totals) {
            if(totalMap.get( == null) {
                totalMap.put(, new List<OpportunityTotal>());            

        List<Decimal> keys = new List<Decimal>(totalMap.keySet());

        /* Sort puts things in ascending order so for descending iterate over
           the keys backwards. */
        for(Integer i = (keys.size()-1);i >= 0; i--) {

        return returnList;



My VF page



         <apex:pageBlockTable value="{!nouvellevueparemploye}" var="ar">
                <apex:column headerValue="Owner Name" value="{!ar.orr.OwnerId}"/>  
                <apex:column headerValue="Detail">
                <apex:pageBlockTable value="{!ar.orr}" var="o">
                    <apex:column value="{!}"/>
                    <apex:column value="{!o.Fee_Paid__c}"/>
                    <apex:column value="{!o.Amount_charged__c}"/> 

If there is another way to display infomation that I would like, let me know :).


Thanks for your support.