I am trying to create a VF Page on the Case, where I should be able to get the Contact associated with the case. I created a Controller extension like below
public with sharing class CaseControllerExtension {
public Id Case_Id {get;set;}
public CaseControllerExtension(ApexPages.StandardController controller) {
Case caseObject = (Case)controller.getRecord();
Case_Id = caseObject.Id;
}
public List<Contact> getAssoContact(String caseId){
List<Case> Cont = [SELECT ContactId from Case where Id =: Case_Id LIMIT 1];
List <Contact> conList = new List<Contact>();
for(Contact con: [SELECT Id, Email, FirstName, LastName, Account.name, MailingCity, MailingState, MailingCountry,Phone
FROM Contact WHERE Id =: Cont[0].ContactId
ORDER BY Id ASC
LIMIT 1]){
conList.add(con);
}
return conList;
}}
And then In the VF Page I am referring the getAssoContact Method so I can reteieve the Contact info like below
<apex:page standardController="Case" extensions="CaseControllerExtension" title="Web Forms" lightningStylesheets="true">
<apex:tabPanel switchType="client" selectedTab="name1" id="theTabPanel">
<apex:tab label="Model Generation Services" name="name3" id="tabThree">
<apex:pageBlock >
<apex:pageBlockTable value="{!AssoContact}" var="con">
<apex:column value="{!con.FirstName}"/>
<apex:column value="{!con.LastName}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:tab>
</apex:tabPanel>
</apex:page>
Here I am getting the error Error: Unknown property 'CaseStandardController.AssoContact'
when saving the VF Page component, can anyone please tell me what I am missing here