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

VF Page- related list issue
I have a created a VF Page that supposed to replace the activity history section in the contact page layout related list. Although I can see it in the page layout, it won't let me add it to the related list section.
public class ActivityController {
private final Contact cont;
public ActivityController (ApexPages.StandardController stdController) {
this.cont = (Contact)stdController.getRecord();
}
public PageReference newTaskforCall()
{
PageReference NewTaskPage = new PageReference('/00T/e?title=Call&who.id=' + System.currentPageReference().getParameters().get('id') + '&followup=1&tsk5=Call&retURL=%2F003R000000ArDZn');
NewTaskPage.setRedirect(true);
return NewTaskPage;
}
public String hasNext { get; set; }
public PageReference next()
{
return null;
}
public String getHasPrevious()
{
return null;
}
public PageReference previous()
{
return null;
}
Public Task[] getActivities()
{
return [Select id, subject, what.name,activitydate, owner.name, lastmodifieddate from Task where whoid = :System.currentPageReference().getParameters().get('id') and calldurationinseconds > 0];
}
public Contact getContact()
{
return [Select id, name
from Contact where id = :System.currentPageReference().getParameters().get('id')];
}
}
<apex:page standardController="Contact" extensions="ActivityController" tabstyle="Contact" sidebar="false">
<apex:form id="myform">
<apex:pageBlock title="Cal History" >
<apex:pageblockButtons >
<apex:commandButton value="Log Call" action="{!newTaskforCall}">
</apex:commandButton>
</apex:pageblockButtons>
<apex:pageBlockSection title="" columns="5" collapsible="true">
<apex:panelGrid columns="2" id="navigation">
</apex:panelGrid>
<apex:dataTable value="{!Activities}" var="each" border="0" styleClass="list">
<apex:column headerValue="Subject"><a href="/{!each.id}">{!each.subject}</a></apex:column>
<apex:column headerValue="Related To"><a href="/{!each.what.Name}">{!each.what.Name}</a></apex:column>
<apex:column headerValue="CSD"><a href="/{!each.owner.id}">{!each.owner.Name}</a></apex:column>
<apex:column headerValue="Due Date">{!each.ActivityDate}</apex:column>
<apex:column headerValue="Last Modified Date/Time">{!each.lastmodifieddate}</apex:column>
</apex:dataTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
