function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
andyaldis1.3969086903835708E12andyaldis1.3969086903835708E12 

Wrapper class error Invalid Type when I try to declare a new List

I am trying to write a wrapper class so I can create a combined lists of tasks and events, I have found several examples and documents that say to define a new public list, but whenever I try to add the list (below in bold).  I get the following error: Invalid type: accountWrapper.  Every example I see looks like they are doing the exact same thing so why do I get the error?

public with sharing class CTRL_MCContactActivities {
    private Contact theContact;
    public Map<String, String> params {get;set;}
    public Integer getRetailActivitesCount {get;set;}
    public String conId;
    public List<Activity_Contact__c> activities {set;get;}
    public List<accountWrapper> display_list {get; set;}
    Public List<Task> taskList {get; set;}
    Public List<Event> eventList {get; set;}
    Public integer tC = 0;
    Public integer eC = 0;
    public string activityId {get; set;}
    public string activityType {get; set;}
    public string createdDate {get; set;}
    public string meetingType {get; set;}
    public string subject {get; set;}
    public string activityDate {get; set;}
    public string description {get; set;}
    public string activityStatus {get; set;}
    public string ownerName {get; set;}

    public CTRL_MCContactActivities(ApexPages.StandardController controller) {
        theContact = (Contact) controller.getRecord();
        If (theContact != null) {
            activities = [SELECT Contact__c, Activity_Type__c, Activity_Subtype__c, Subject__c, Due_Date__c,
                                 Short_Description__c, Activity_Status__c, Assigned_To__c
                         FROM Activity_Contact__c
                         WHERE Contact__c = :theContact.Id
                         ORDER BY Due_Date__c DESC
                         LIMIT 50];
        } else {
            activities = new List<Activity_Contact__c>();
      }
    }
  //  remove this comment }

    public class activityWapper{
      
    }
    public Integer getRetailActivitesCount() {
           return  [SELECT count() FROM Task WHERE Id in (Select taskId from taskRelation where Relationid = :conId)  AND (RecordTypeId = '0126000000018NT' OR RecordTypeId = '0126000000018NU')];
    }






}
 
Best Answer chosen by andyaldis1.3969086903835708E12
Wilfredo Morillo 20Wilfredo Morillo 20
You need to create a class called accountWrapper if you haven't. That's why you are getting the error. 

All Answers

Wilfredo Morillo 20Wilfredo Morillo 20
You need to create a class called accountWrapper if you haven't. That's why you are getting the error. 
This was selected as the best answer
andyaldis1.3969086903835708E12andyaldis1.3969086903835708E12
Yep, that was it.    Thank you for the reply.