You need to sign in to do that
Don't have an account?
Attach Open Activities to Case
Hi, I created a VF page where we can search for a case using the case number.
However, in the result, I also want to display the Open Activites related to the Case.
I am able to reference the Case object fields in the page, but cannot figure out how to do that with the Open Activites fields (Status, Priority, Subject)
Controller:
public class casesearchcontroller {
public list <case> cas {get;set;}
public casesearchcontroller(ApexPages.StandardController controller) {
}
public string searchstring {get;set;}
public void search(){
string searchquery='select casenumber,Email__c,Category__c,SubCategory__c,(Select ActivityDate, Status, Priority,Subject FROM OpenActivities)from case where CaseNumber like \'%'+searchstring+'%\' Limit 30';
cas= Database.query(searchquery);
}
public void clear(){
cas.clear();
}
}
Page:
<apex:page standardController="Case" extensions="caseextension" showheader="false" >
<apex:form >
<apex:inputText value="{!searchstring}" label="Input"/>
<apex:commandButton value="Find Case" action="{!search}"/>
<apex:commandButton value="Clear Search" action="{!search}"/>
<apex:pageBlock title="Search Result">
<apex:pageblockTable value="{!cas}" var="c">
<apex:column value="{!c.CaseNumber}"/>
<apex:column value="{!c.Email__c}"/>
<apex:column value="{!c.Category__c}"/>
<apex:column value="{!c.SubCategory__c}"/>
</apex:pageblocktable>
</apex:pageBlock>
</apex:form>
</apex:page>
Any help?
Thanks!
something like
list<task> tasklist = cas.openactivities;