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
Ratheven SivarajahRatheven Sivarajah 

I am trying to make a visualforce page with the following controller but I am writing it wrong somewhere

Hey Everyone, I am trying to make a visualforce page with the following controller but I am recieveing an error unknown property operation_class.cases on the VF page. Need help. Thank you in advance

---------------controler----------------
public class operations_class{
    
    list<AccountWrapper> accountWrapperList = new list<AccountWrapper>();
    public String currentRecordId {get;set;}
    
    public operations_class(){
        Map<Id, AccountWrapper> accountMap = new Map<Id, AccountWrapper>();
        
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        for(case acc :[SELECT CreatedById, Quote_Request__r.name FROM case WHERE id =: currentRecordId ]){
            
            AccountWrapper accountWrap = accountMap.get(acc.CreatedByID);
            if (null==accountWrap){
                accountWrap = new AccountWrapper();
                accountMap.put(acc.CreatedByID, accountWrap);
                accountWrap.userId=acc.CreatedById;
            }
            
            accountWrap.cases.add(acc);
        }       
        accountWrapperList = accountMap.values();
    }
    
    public list<AccountWrapper> getAccounts()
    {
        return accountWrapperList;
    }
    
    public class AccountWrapper
    {
        public Id userId {get; set;}
        public List<case> cases {get; set;}
        public AccountWrapper()
        {
            cases=new List<case>();
        }
    }
}


----------VFpage------------------------------
<apex:page controller="operations_class">
    <table>
        <apex:repeat value="{!cases}" var="cas">
                    <tr>
                        <td>
                            <apex:outputText value="Name : {!cas.Name}"/>
                        </td>                       
                    </tr>    
           </apex:repeat>
    </table>
</apex:page>
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Can you confirm what exactly you are trying to achieve using this vf page so can check and let you know the issue here.

Thanks,
 
Ratheven SivarajahRatheven Sivarajah
Hey Sai thank you for your help. I am doing a Soql on a custom object which is a lookup to a standard object. I want to display the name of the custome object. The SOQL works and I dont where I am making a mistake. I have made some changes please take a look
--------------------------class--------------
public class operations_class{
    public List<Case> getNewCases(){
        List<Case> filterList = [SELECT AccountId,CreatedById,Quote_Request__r.name FROM case WHERE Id ='50005000005ym2OAAQ' ];
        return filterList;
    }
}

-----------------------------VFpage-----------------------------
<apex:page controller="operations_class">
    <apex:pageBlock>
        <apex:pageBlockTable   value="{!filterList}" var="a">        
                <apex:column value="{!a.Quote_Request__r.name}"></apex:column>      
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>