I want to display on my case layout other open Cases related to Account from case. I have got a VFP to display them on my Account page layout but I can't display them on my Case layout. Any ideas what to do? I could get those records without VF with trigger on my Cases but i try to find different way to do that.
VFP code:
<apex:page standardController="Account" extensions="contrller">
<apex:form >
<apex:pageblock >
<apex:pageBlockTable value="{!relatedCases}" var="val">
<apex:facet name="header"><b>Open Customer Service Cases</b></apex:facet>
<apex:column value="{!val.CaseNumber}"/>
<apex:column value="{!val.Status}"/>
<apex:column value="{!val.RecordTypeId}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
with controller:
public with sharing class contrller {
Public id Current_Acc_Id;
public contrller(ApexPages.StandardController controller) {
Current_Acc_Id = controller.getRecord().id;
}
public List<Case> getrelatedCases(){
List <case> conList = New List<Case>();
for(Account acc:[select (select status, CaseNumber, RecordTypeId from cases WHERE RecordTypeId = '01220000000QawC' AND Status != 'Closed') from account where id=:Current_Acc_Id]){
for(case con:acc.cases)
conList.add(con);
}
return conList;
}
}