Skip to main content
Hi, am getting error message re Invalid Type in the Developer Console for an Apex class for a provided solution to a Visualforce Controller Training Course (exercise 3-4, Creating a Controller Using an Object Wrapper Class).  Error is saying that "MyOutstandingReview" is an invalid type.  Would appreciate direction on what I need to do to fix this error please.

 

The line throwing the error is:

 

 public List<MyOutstandingReview> myOutstandingReviews{

 

The fuller context for the exercise in the training is:

 

  // TODO:     Create a public list "myOutstandingReviews", which contains elements

 

    //                 of type MyOutstandingReview. Override the getter.

 

    //                If null (on the first access), instantiate a new list.

 

    //                Iterate over the list of review__c records called "reviews" in a FOR loop.

 

    //                For each Review__c record, instantiate a new object 

 

    //                of type MyOutstandingReview. Pass the iteration variable to the 

 

    //                constructor. Add the new object to the list "MyOutstandingReviews".

 

    //                Always return the newly created list "MyOutstandingReviews"

 

        //                Use the default setter.

 

    public List<MyOutstandingReview> myOutstandingReviews{

 

        get{

 

            // perform the logic to find the Reviews that have not yet been completed for the current Position

 

            if (myOutstandingReviews == null) {

 

                myOutstandingReviews = new List<MyOutstandingReview>();

 

                for(Review__c review:reviews){

 

                    MyOutstandingReview record = new MyOutstandingReview(review);

 

                    myOutstandingReviews.add(record);

 

                }

 

            }

 

            return myOutstandingReviews;

 

        }

 

        set;    

 

    }

 

Thank you.

 

  

 

Context 
3 Antworten
  1. 21. Dez. 2015, 09:47
    Hi ,

     

    You might get an answer here - there are tons of really smart admins in this community - however, this Answers Community is focused on configuration and design questions. Programmatic questions are best submitted to the developer forums at

     

     https://developer.salesforce.com

     

    http://salesforce.stackexchange.com/

     

    where the forums and participants are geared toward programming troubleshooting and support and the users there focus on code so you may get quicker answers as well as a wider variety of options.

     

    PS: Mark a best answer as well so that thread is closed and help us to keep community clean.

     

    Thanks

     

    Vinay
0/9000