• Natasha Martin
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Digital Marketing Specialist
  • American Fidelity


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I’m trying to finish up the Visualforce Basics module in Trailhead and keep receiving this error:
Challenge not yet complete... here's what's wrong: 
No Apex class named 'NewCaseListController' was found
 
When I view the setup page in my developer account it shows my Apex class is listed as “ContactsListController” but when I open the class it shows the correct name – “NewCaseListController”.
 
I’ve tried deleting the class and editing the name and nothing is changing the name shown on the setup page.
 
Could this be causing the error message above in Trailhead?
Any suggestions on how to fix it?
(see screenshot and code below)

Controller code:
public class NewCaseListController {
List<Case> results = new List<Case>();


private String sortOrder = 'CaseNumber';
public List<Case> getNewCases() {
    results = [SELECT Id, CaseNumber FROM Case WHERE status = 'new'];

    return results;
    }
}

Page code:
<apex:page controller="NewCaseListController">
    <apex:form >
        <apex:pageBlock title="Case List" id="Case_list">
            <!-- Case_list -->
         <apex:repeat value="{!newCases}" var="case">
         <table style="width:1000px;">
              <tr>
                  <br/>
                  <apex:outputLink value="/{!case.Id}" style="width:160px">{!case.Id}</apex:outputLink>
                  <br/>
               </tr>
           </table>
        </apex:repeat>     
        </apex:pageBlock>
    </apex:form>
</apex:page>



User-added image
 
I’m trying to finish up the Visualforce Basics module in Trailhead and keep receiving this error:
Challenge not yet complete... here's what's wrong: 
No Apex class named 'NewCaseListController' was found
 
When I view the setup page in my developer account it shows my Apex class is listed as “ContactsListController” but when I open the class it shows the correct name – “NewCaseListController”.
 
I’ve tried deleting the class and editing the name and nothing is changing the name shown on the setup page.
 
Could this be causing the error message above in Trailhead?
Any suggestions on how to fix it?
(see screenshot and code below)

Controller code:
public class NewCaseListController {
List<Case> results = new List<Case>();


private String sortOrder = 'CaseNumber';
public List<Case> getNewCases() {
    results = [SELECT Id, CaseNumber FROM Case WHERE status = 'new'];

    return results;
    }
}

Page code:
<apex:page controller="NewCaseListController">
    <apex:form >
        <apex:pageBlock title="Case List" id="Case_list">
            <!-- Case_list -->
         <apex:repeat value="{!newCases}" var="case">
         <table style="width:1000px;">
              <tr>
                  <br/>
                  <apex:outputLink value="/{!case.Id}" style="width:160px">{!case.Id}</apex:outputLink>
                  <br/>
               </tr>
           </table>
        </apex:repeat>     
        </apex:pageBlock>
    </apex:form>
</apex:page>



User-added image