• Patrick J O'Sullivan
  • NEWBIE
  • 20 Points
  • Member since 2014
  • CRM Manager
  • ISS

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi Guys,

I am Studying Apex and VF at the moment but My boss won't wait for me to finish my studies before forcing me to develop,
I've got the basics pretty well and have created a controller extension and page and now need to deploy from sandbox but I don't know how to test a controller extension and I can't figure it out from the 501 learning materials.

The contoller is simply pulling KAM plan actions into list variables based on time and status, this is to allow a contextual quick look feature for our Head of sales when reviewing Key account management synopses. 

Could someone please using my controller below explain to me how I go about testing this? I am afraid I am really struggling to understand testing VF controllers and extensions.....

My Page is Called KAMBasic 

My controller is:
public class KAMKAPextension 
{
  private final Key_Account_Overview__c KAP;
    List<Kam_Plan_Actions__c> overdue;
    List<Kam_Plan_Actions__c> next30days;
    List<Kam_Plan_Actions__c> from30to60days;
    List<Kam_Plan_Actions__c> from60to90days;
    List<Kam_Plan_Actions__c> longterm;
    List<Kam_Plan_actions__c> Completed;
    List<Kam_Plan_actions__c> cancelled;
    list<Kam_Plan_actions__c> KamToday;
    
    //Method for new Child Kam Plan Action goes here
    
    
public KAMKAPextension(ApexPages.StandardController KAPController) {
     this.KAP = (Key_Account_Overview__c)KAPController.getRecord();
}
  
Public list<Kam_Plan_Actions__c>
        getoverdue() {
            If (overdue == null) 
            {
                overdue = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c < TODAY AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return overdue;
        }
Public list<Kam_Plan_Actions__c>
        getKamToday() {
            If (KamToday == null) 
            {
                KamToday = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c =:KAP.id];
            }
            return KamToday;
        }
Public list<Kam_Plan_Actions__c>
        getnext30days() {
            If (next30days == null) 
            {
                next30days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >= TODAY AND due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c =:KAP.id];
            }
            return next30days;
        }
Public list<Kam_Plan_Actions__c>
        getfrom30to60days() {
            If (from30to60days == null) 
            {
                from30to60days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:29  AND due_date__c = NEXT_N_DAYS:59 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return from30to60days;
        }
Public list<Kam_Plan_Actions__c>
        getfrom60to90days() {
            If (from60to90days == null) 
            {
                from60to90days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:59  AND due_date__c = NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return from60to90days;
        }
    Public list<Kam_Plan_Actions__c>
        getlongterm() {
            If (longterm == null) 
            {
                longterm = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c > TODAY AND due_date__c != TODAY AND due_date__c !=NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return longterm;
        }
            Public list<Kam_Plan_Actions__c>
        getCompleted() {
            If (Completed == null) 
            {
                Completed = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >NEXT_N_DAYS:89 AND Status__c ='Complete'AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return Completed;
        }
    Public list<Kam_Plan_Actions__c>
        getcancelled() {
            If (cancelled == null) 
            {
                cancelled = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE Status__c ='Completed' AND  Key_Account_Synopsis__c =:KAP.id ];
            }
            return cancelled;
        }
}


Hi Guys,

I've written my first Extension class to use within a VF override on my custom key account synopsis object...

I'm stuck at 74% coverage can you guys take a look and see if you can spot what will bring it above the threshold please? getting a bit desperate 

public class KAMKAPextension 
{
  private final Key_Account_Overview__c KAP;
    List<Kam_Plan_Actions__c> overdue;
    List<Kam_Plan_Actions__c> next30days;
    List<Kam_Plan_Actions__c> from30to60days;
    List<Kam_Plan_Actions__c> from60to90days;
    List<Kam_Plan_Actions__c> longterm;
    List<Kam_Plan_actions__c> Completed;
    List<Kam_Plan_actions__c> cancelled;
    list<Kam_Plan_actions__c> KamToday;
    
    //Method for new Child Kam Plan Action goes here
    
    
public KAMKAPextension(ApexPages.StandardController KAPController) {
     this.KAP = (Key_Account_Overview__c)KAPController.getRecord();
}
  
Public list<Kam_Plan_Actions__c>
        getoverdue() {
            If (overdue == null) 
            {
                overdue = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c < TODAY AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return overdue;
        }
Public list<Kam_Plan_Actions__c>
        getKamToday() {
            If (KamToday == null) 
            {
                KamToday = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c =:KAP.id];
            }
            return KamToday;
        }
Public list<Kam_Plan_Actions__c>
        getnext30days() {
            If (next30days == null) 
            {
                next30days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >= TODAY AND due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c =:KAP.id];
            }
            return next30days;
        }
Public list<Kam_Plan_Actions__c>
        getfrom30to60days() {
            If (from30to60days == null) 
            {
                from30to60days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:29  AND due_date__c = NEXT_N_DAYS:59 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return from30to60days;
        }
Public list<Kam_Plan_Actions__c>
        getfrom60to90days() {
            If (from60to90days == null) 
            {
                from60to90days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:59  AND due_date__c = NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return from60to90days;
        }
    Public list<Kam_Plan_Actions__c>
        getlongterm() {
            If (longterm == null) 
            {
                longterm = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c > TODAY AND due_date__c != TODAY AND due_date__c !=NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return longterm;
        }
            Public list<Kam_Plan_Actions__c>
        getCompleted() {
            If (Completed == null) 
            {
                Completed = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >NEXT_N_DAYS:89 AND Status__c ='Complete'AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return Completed;
        }
    Public list<Kam_Plan_Actions__c>
        getcancelled() {
            If (cancelled == null) 
            {
                cancelled = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE Status__c ='Completed' AND  Key_Account_Synopsis__c =:KAP.id ];
            }
            return cancelled;
        }
}


I am trying to create an extension for my Key_Account_Overview__c object pulling specifically filtered lists from my Kam_Plan_Actions__c object which is a master detail child of Key_Account_Overview__c.

my extension class (KAMKAPextension) seems to have no errors and neither does my VF page (KAMbasic) but when I render the VF page I get:

Visualforce Error
Help for this Page

System.TypeException: Invalid conversion from runtime type SOBJECT:Key_Account_Overview__c to SOBJECT:Kam_Plan_Actions__c
Class.KAMKAPextension.<init>: line 14, column 1

I am pretty sure I have made an illegal assignment in line 14 but can't figure it out, I am trying to teach myself APEX currently so it may be a complete newbie mistake but I just don't know enough yet to spot my mistake.

this.KAP = (Key_Account_Overview__c)KAPController.getRecord();

any help would be much appreciated, the code for my class and page are below, please ignore the place holder Items I am focusing on the lists first and the rest were injected for proposal demo purposes for my COO.

Extension class:
public class KAMKAPextension 
{
  private final Kam_Plan_Actions__c KAP;
    List<Kam_Plan_Actions__c> overdue;
    List<Kam_Plan_Actions__c> next30days;
    List<Kam_Plan_Actions__c> from30to60days;
    List<Kam_Plan_Actions__c> from60to90days;
    List<Kam_Plan_Actions__c> longterm;
    List<Kam_Plan_actions__c> Completed;
    List<Kam_Plan_actions__c> Postponed;
    
  public KAMKAPextension(ApexPages.StandardController
								KAPController) {
								this.KAP = (Key_Account_Overview__c)KAPController.getRecord();
								}
  Public list<Kam_Plan_Actions__c>
        getoverdue() {
            If (overdue == null) 
            {
                overdue = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c < TODAY AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return overdue;
        }
    Public list<Kam_Plan_Actions__c>
        getnext30days() {
            If (next30days == null) 
            {
                next30days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >= TODAY AND due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return next30days;
        }
    Public list<Kam_Plan_Actions__c>
        getfrom30to60days() {
            If (from30to60days == null) 
            {
                from30to60days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:29  AND due_date__c = NEXT_N_DAYS:59 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return from30to60days;
        }
    Public list<Kam_Plan_Actions__c>
        getfrom60to90days() {
            If (from60to90days == null) 
            {
                from60to90days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:59  AND due_date__c = NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return from60to90days;
        }
    Public list<Kam_Plan_Actions__c>
        getlongterm() {
            If (longterm == null) 
            {
                longterm = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c > TODAY AND due_date__c != TODAY AND due_date__c !=NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return longterm;
        }
  
}

VF Page:
<apex:page showHeader="true" docType="html-5.0" StandardController="Key_Account_Overview__c" extensions="KAMKAPextension">  
<!-- Style Override -->
     <style>
        .activeTab {background-color: blue; color:white; font-style:italic; font-weight:bold;
        background-image:none}
        .inactiveTab { background-color: lightblue; color:black;font-style:normal; font-weight:normal;
        background-image:none}
    </style>

<!---Tab Panel: -->
        <apex:tabPanel switchType="client" selectedTab="tabdetails"
        id="AccountTabPanel" tabClass="activeTab"
        inactiveTabClass="inactiveTab">
<!-- Individual Tabs -->
            <apex:tab label="Executive Summary" name="ExSum" id="tabExec">
<chatter:follow entityId="{!Key_Account_Overview__c.id}"/>
                <chatter:followers entityId="{!Key_Account_Overview__c.id}"/>
                <apex:pageBlock title="Executive Summary">
                    <Apex:outputField label="Executive Overview" value="{!Key_Account_Overview__c.Executive_Summary__c}"/>
                </apex:pageBlock>
                <apex:pageBlock title="Financial variance">
                  <br>Financial Variance percentages goe here:</br>
                  <br>1. Estimate v Target</br>
                  <br>2. Actual v Target</br>
                  <br>3. Actual v Estimate <Apex:outputField label="Actual v Estimate" value="{!Key_Account_Overview__c.Financials_Variance__c}"/></br>
                </apex:pageBlock>
            </apex:tab>
            <apex:tab label="Chatter">
                <chatter:feed entityId="{!Key_Account_Overview__c.id}"/>
            </apex:tab>
            <apex:tab label="Company Profile" name="CompanyProfile" id="tabComPro">
                <apex:pageBlock title="Company information">
                    <Apex:outputField value="{!Key_Account_Overview__c.Company_Information__c}"/>
                </apex:pageBlock>
                <apex:pageBlock title="Financials">
                  <br>"Target Financials:    "<apex:outputfield label="Target Financials" value="{!Key_Account_Overview__c.Target_Financials__c}"/> </br>
                  <br>"financials last Year:    "<apex:outputfield label="financials last Year" value="{!Key_Account_Overview__c.Financials_last_year__c}"/></br>
                  <br>"financials this Year:    "<apex:outputfield label="financials this Year" value="{!Key_Account_Overview__c.Financials_this_year__c}"/></br>
                </apex:pageBlock>
               <apex:pageBlock title="Port Call Data">
                   <br><apex:outputfield label="Port calls this year" value="{!Key_Account_Overview__c.Port_Calls_this_year_to_date__c}"/> </br>
                   <br><apex:outputfield label="Port calls last year" value="{!Key_Account_Overview__c.Port_Calls_last_year__c}"/> </br>
                   <br><apex:outputfield label="Port Call Variance" value="{!Key_Account_Overview__c.Port_Calls_variance__c}"/> </br>
               </apex:pageBlock>
            </apex:tab>
            <apex:tab label="Key Progress Indicators" name="KPI"
            id="tabKPI">
            <apex:relatedList subject="{!Key_Account_Overview__c}" list="Account_Analyses__r" />
            <apex:relatedList subject="{!Key_Account_Overview__c}" list="QCR_Grids__r" />
            <apex:relatedList subject="{!Key_Account_Overview__c}" list="Objective_Progress_Trackers__r" />
            </apex:tab>
            <apex:tab label="Customer Objectives" name="CustomerObjectives"
            id="tabCusObj">
            <apex:pageBlock title="Customer Objectives">
            <br><b>Primary Objectives</b><apex:outputfield value="{!Key_Account_Overview__c.Primary_Customer_objectives__c}"/> </br>
<br><b>Secondary Objectives </b><apex:outputfield value="{!Key_Account_Overview__c.Secondary_Customer_objectives__c}"/> </br>
</apex:pageBlock>
            </apex:tab>
            <apex:tab label="KAM Objectives"
            name="KAMObjectives" id="tabKAMObj">
            <apex:pageBlock >
<br><b>Kam Objectives </b><apex:outputfield label="Primary cust. objectives" value="{!Key_Account_Overview__c.KAM_Objectives__c}"/> </br>

</apex:pageBlock>
            </apex:tab>
<!-- KAM Plan tab Accordian style -->
            <Apex:tab label="KAM Plan" Name="KAMPlan" id="KAMP">
            <apex:form >
            <apex:pageblock title="KAM Plan">
            <br>KAM Mission overview goes here....</br>
            </apex:pageblock>
            <apex:pageblock >  
        <c:Accordion >
            <c:AccordionSection title="Overdue" >
            	<apex:pageBlockTable value="{!overdue}"  var="kact">
                    <apex:column Headervalue="Kam Action" value="{!kact.name}"/>
                </apex:pageBlockTable>
            </c:AccordionSection>
            <c:AccordionSection title="Next 30 days">
            </c:AccordionSection>
            <c:AccordionSection title="Next 60 days">
            </c:AccordionSection>
            <c:AccordionSection title="Next 90 days">
            </c:AccordionSection>
            <c:AccordionSection title="Long Term View">
            </c:AccordionSection>
    </c:Accordion>
    </apex:pageblock>
            </apex:form>
            </apex:tab>
        </apex:tabPanel>

 </apex:page>

Hi Guys,

I am Studying Apex and VF at the moment but My boss won't wait for me to finish my studies before forcing me to develop,
I've got the basics pretty well and have created a controller extension and page and now need to deploy from sandbox but I don't know how to test a controller extension and I can't figure it out from the 501 learning materials.

The contoller is simply pulling KAM plan actions into list variables based on time and status, this is to allow a contextual quick look feature for our Head of sales when reviewing Key account management synopses. 

Could someone please using my controller below explain to me how I go about testing this? I am afraid I am really struggling to understand testing VF controllers and extensions.....

My Page is Called KAMBasic 

My controller is:
public class KAMKAPextension 
{
  private final Key_Account_Overview__c KAP;
    List<Kam_Plan_Actions__c> overdue;
    List<Kam_Plan_Actions__c> next30days;
    List<Kam_Plan_Actions__c> from30to60days;
    List<Kam_Plan_Actions__c> from60to90days;
    List<Kam_Plan_Actions__c> longterm;
    List<Kam_Plan_actions__c> Completed;
    List<Kam_Plan_actions__c> cancelled;
    list<Kam_Plan_actions__c> KamToday;
    
    //Method for new Child Kam Plan Action goes here
    
    
public KAMKAPextension(ApexPages.StandardController KAPController) {
     this.KAP = (Key_Account_Overview__c)KAPController.getRecord();
}
  
Public list<Kam_Plan_Actions__c>
        getoverdue() {
            If (overdue == null) 
            {
                overdue = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c < TODAY AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return overdue;
        }
Public list<Kam_Plan_Actions__c>
        getKamToday() {
            If (KamToday == null) 
            {
                KamToday = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c =:KAP.id];
            }
            return KamToday;
        }
Public list<Kam_Plan_Actions__c>
        getnext30days() {
            If (next30days == null) 
            {
                next30days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >= TODAY AND due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c =:KAP.id];
            }
            return next30days;
        }
Public list<Kam_Plan_Actions__c>
        getfrom30to60days() {
            If (from30to60days == null) 
            {
                from30to60days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:29  AND due_date__c = NEXT_N_DAYS:59 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return from30to60days;
        }
Public list<Kam_Plan_Actions__c>
        getfrom60to90days() {
            If (from60to90days == null) 
            {
                from60to90days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:59  AND due_date__c = NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return from60to90days;
        }
    Public list<Kam_Plan_Actions__c>
        getlongterm() {
            If (longterm == null) 
            {
                longterm = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c > TODAY AND due_date__c != TODAY AND due_date__c !=NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled' AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return longterm;
        }
            Public list<Kam_Plan_Actions__c>
        getCompleted() {
            If (Completed == null) 
            {
                Completed = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >NEXT_N_DAYS:89 AND Status__c ='Complete'AND  Key_Account_Synopsis__c = :KAP.id];
            }
            return Completed;
        }
    Public list<Kam_Plan_Actions__c>
        getcancelled() {
            If (cancelled == null) 
            {
                cancelled = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE Status__c ='Completed' AND  Key_Account_Synopsis__c =:KAP.id ];
            }
            return cancelled;
        }
}


I am trying to create an extension for my Key_Account_Overview__c object pulling specifically filtered lists from my Kam_Plan_Actions__c object which is a master detail child of Key_Account_Overview__c.

my extension class (KAMKAPextension) seems to have no errors and neither does my VF page (KAMbasic) but when I render the VF page I get:

Visualforce Error
Help for this Page

System.TypeException: Invalid conversion from runtime type SOBJECT:Key_Account_Overview__c to SOBJECT:Kam_Plan_Actions__c
Class.KAMKAPextension.<init>: line 14, column 1

I am pretty sure I have made an illegal assignment in line 14 but can't figure it out, I am trying to teach myself APEX currently so it may be a complete newbie mistake but I just don't know enough yet to spot my mistake.

this.KAP = (Key_Account_Overview__c)KAPController.getRecord();

any help would be much appreciated, the code for my class and page are below, please ignore the place holder Items I am focusing on the lists first and the rest were injected for proposal demo purposes for my COO.

Extension class:
public class KAMKAPextension 
{
  private final Kam_Plan_Actions__c KAP;
    List<Kam_Plan_Actions__c> overdue;
    List<Kam_Plan_Actions__c> next30days;
    List<Kam_Plan_Actions__c> from30to60days;
    List<Kam_Plan_Actions__c> from60to90days;
    List<Kam_Plan_Actions__c> longterm;
    List<Kam_Plan_actions__c> Completed;
    List<Kam_Plan_actions__c> Postponed;
    
  public KAMKAPextension(ApexPages.StandardController
								KAPController) {
								this.KAP = (Key_Account_Overview__c)KAPController.getRecord();
								}
  Public list<Kam_Plan_Actions__c>
        getoverdue() {
            If (overdue == null) 
            {
                overdue = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c < TODAY AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return overdue;
        }
    Public list<Kam_Plan_Actions__c>
        getnext30days() {
            If (next30days == null) 
            {
                next30days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c >= TODAY AND due_date__c = NEXT_N_DAYS:29 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return next30days;
        }
    Public list<Kam_Plan_Actions__c>
        getfrom30to60days() {
            If (from30to60days == null) 
            {
                from30to60days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:29  AND due_date__c = NEXT_N_DAYS:59 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return from30to60days;
        }
    Public list<Kam_Plan_Actions__c>
        getfrom60to90days() {
            If (from60to90days == null) 
            {
                from60to90days = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c !=NEXT_N_DAYS:59  AND due_date__c = NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return from60to90days;
        }
    Public list<Kam_Plan_Actions__c>
        getlongterm() {
            If (longterm == null) 
            {
                longterm = [
                    SELECT Id, Name, Status__c, Due_Date__c 
                    FROM Kam_Plan_Actions__c 
                    WHERE due_date__c > TODAY AND due_date__c != TODAY AND due_date__c !=NEXT_N_DAYS:89 AND Status__c !='Complete' AND Status__c !='Cancelled'];
            }
            return longterm;
        }
  
}

VF Page:
<apex:page showHeader="true" docType="html-5.0" StandardController="Key_Account_Overview__c" extensions="KAMKAPextension">  
<!-- Style Override -->
     <style>
        .activeTab {background-color: blue; color:white; font-style:italic; font-weight:bold;
        background-image:none}
        .inactiveTab { background-color: lightblue; color:black;font-style:normal; font-weight:normal;
        background-image:none}
    </style>

<!---Tab Panel: -->
        <apex:tabPanel switchType="client" selectedTab="tabdetails"
        id="AccountTabPanel" tabClass="activeTab"
        inactiveTabClass="inactiveTab">
<!-- Individual Tabs -->
            <apex:tab label="Executive Summary" name="ExSum" id="tabExec">
<chatter:follow entityId="{!Key_Account_Overview__c.id}"/>
                <chatter:followers entityId="{!Key_Account_Overview__c.id}"/>
                <apex:pageBlock title="Executive Summary">
                    <Apex:outputField label="Executive Overview" value="{!Key_Account_Overview__c.Executive_Summary__c}"/>
                </apex:pageBlock>
                <apex:pageBlock title="Financial variance">
                  <br>Financial Variance percentages goe here:</br>
                  <br>1. Estimate v Target</br>
                  <br>2. Actual v Target</br>
                  <br>3. Actual v Estimate <Apex:outputField label="Actual v Estimate" value="{!Key_Account_Overview__c.Financials_Variance__c}"/></br>
                </apex:pageBlock>
            </apex:tab>
            <apex:tab label="Chatter">
                <chatter:feed entityId="{!Key_Account_Overview__c.id}"/>
            </apex:tab>
            <apex:tab label="Company Profile" name="CompanyProfile" id="tabComPro">
                <apex:pageBlock title="Company information">
                    <Apex:outputField value="{!Key_Account_Overview__c.Company_Information__c}"/>
                </apex:pageBlock>
                <apex:pageBlock title="Financials">
                  <br>"Target Financials:    "<apex:outputfield label="Target Financials" value="{!Key_Account_Overview__c.Target_Financials__c}"/> </br>
                  <br>"financials last Year:    "<apex:outputfield label="financials last Year" value="{!Key_Account_Overview__c.Financials_last_year__c}"/></br>
                  <br>"financials this Year:    "<apex:outputfield label="financials this Year" value="{!Key_Account_Overview__c.Financials_this_year__c}"/></br>
                </apex:pageBlock>
               <apex:pageBlock title="Port Call Data">
                   <br><apex:outputfield label="Port calls this year" value="{!Key_Account_Overview__c.Port_Calls_this_year_to_date__c}"/> </br>
                   <br><apex:outputfield label="Port calls last year" value="{!Key_Account_Overview__c.Port_Calls_last_year__c}"/> </br>
                   <br><apex:outputfield label="Port Call Variance" value="{!Key_Account_Overview__c.Port_Calls_variance__c}"/> </br>
               </apex:pageBlock>
            </apex:tab>
            <apex:tab label="Key Progress Indicators" name="KPI"
            id="tabKPI">
            <apex:relatedList subject="{!Key_Account_Overview__c}" list="Account_Analyses__r" />
            <apex:relatedList subject="{!Key_Account_Overview__c}" list="QCR_Grids__r" />
            <apex:relatedList subject="{!Key_Account_Overview__c}" list="Objective_Progress_Trackers__r" />
            </apex:tab>
            <apex:tab label="Customer Objectives" name="CustomerObjectives"
            id="tabCusObj">
            <apex:pageBlock title="Customer Objectives">
            <br><b>Primary Objectives</b><apex:outputfield value="{!Key_Account_Overview__c.Primary_Customer_objectives__c}"/> </br>
<br><b>Secondary Objectives </b><apex:outputfield value="{!Key_Account_Overview__c.Secondary_Customer_objectives__c}"/> </br>
</apex:pageBlock>
            </apex:tab>
            <apex:tab label="KAM Objectives"
            name="KAMObjectives" id="tabKAMObj">
            <apex:pageBlock >
<br><b>Kam Objectives </b><apex:outputfield label="Primary cust. objectives" value="{!Key_Account_Overview__c.KAM_Objectives__c}"/> </br>

</apex:pageBlock>
            </apex:tab>
<!-- KAM Plan tab Accordian style -->
            <Apex:tab label="KAM Plan" Name="KAMPlan" id="KAMP">
            <apex:form >
            <apex:pageblock title="KAM Plan">
            <br>KAM Mission overview goes here....</br>
            </apex:pageblock>
            <apex:pageblock >  
        <c:Accordion >
            <c:AccordionSection title="Overdue" >
            	<apex:pageBlockTable value="{!overdue}"  var="kact">
                    <apex:column Headervalue="Kam Action" value="{!kact.name}"/>
                </apex:pageBlockTable>
            </c:AccordionSection>
            <c:AccordionSection title="Next 30 days">
            </c:AccordionSection>
            <c:AccordionSection title="Next 60 days">
            </c:AccordionSection>
            <c:AccordionSection title="Next 90 days">
            </c:AccordionSection>
            <c:AccordionSection title="Long Term View">
            </c:AccordionSection>
    </c:Accordion>
    </apex:pageblock>
            </apex:form>
            </apex:tab>
        </apex:tabPanel>

 </apex:page>