You need to sign in to do that
Don't have an account?

how to sort activity histories based on last modified date
Hi All,
I have replaced Activity History related list with a VF page using Standard Controller, the issue is data is not displaying order by, I want to sort the activity histories based on lastModified date/time, how to do that ? any help is highly appreciated.
Here is the VF:
<apex:page standardController="Case" extensions="ActivityHistory_cls">
<apex:form >
<apex:pageBlock title="Activity History" >
<apex:pageBlockTable value="{!Case.ActivityHistories}" var="list" id="theId">
<apex:column headerValue="Subject"><apex:outputField value="{!list.Subject}"/> </apex:column>
<apex:column headerValue="Name"><apex:outputField value="{!list.WhoId}"/> </apex:column>
<apex:column headerValue="Task"> <apex:outputField value="{!list.IsTask}"/> </apex:column>
<apex:column headerValue="Due Date"> <apex:outputField value="{!list.ActivityDate}"/> </apex:column>
<apex:column headerValue="LastModified Date/Time"> <apex:outputField value="{!list.LastModifiedDate}"/></apex:column>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks in advance,
SK
in class you should write a query
Public List<ActivityHistories> acv{get;set;}
acv=[select id,........from ...... Order by LastModifiedDate];
like this
By using this query you need to access Pageblock table values...
prem
Thanks for the reply prem.
I have used child relationship to get/display the values on page, i.e. {!Case.ActivityHistories.Status} with out querying. I dont know why it is not displaying standard order by, is it possible with out writing a query in a controller class.
SK.
I don't think so..
But how it is Possible..
We should write a query must i think..
Prem
In the above VF page, controller is taken to override "VeiwAll" button only,