Need help to create vf page where i want to display list of cases on case record page, created by same contact of current case. Also it will based on 2 custom fields values(i.e. product & Component). Based on these 3 fields i want make vf page and display it under case record page.
i have created vf page and controller but not sure how to proceed with criteria.
vf page:
<apex:page standardController="Case" recordSetVar="c" extensions="caselistcontroller">
<apex:pageBlock >
<apex:pageBlockTable value="{!c}" var="cs">
<apex:column value="{!cs.CaseNumber}"/>
<apex:column value="{!cs.Products__c}"/>
<apex:column value="{!cs.ContactId}"/>
</apex:pageBlockTable>
</apex:pageBlock>
Controller:
for controller till the point to fetch contact id from case i have written logic.
public class caselistcontroller
{
public Contact con{get;set;}
public Case caseObject{get;set;}
public caselistcontroller(ApexPages.StandardsetController controller)
{
con = new Contact();
caseObject = new case();
caseObject = (Case)controller.getRecord();
//Get the Currently logged in community user contact id
String cntId = [SELECT Id, ContactId, Name FROM User WHERE Id =: UserInfo.getUserId()].ContactId;
caseObject.ContactId = cntId;
}
}
Can any one guide me in right direction. That would be helpful.