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
dhruv mehta 15dhruv mehta 15 

Creating & Using Custom Controllers Trailhead Challenge Issue

Hi everyone,

I have used the following codes for Creating & Using Custom Controllers Trailhead Challenge .

for New Case list

<apex:page controller="NewCaseListController">
    <apex:form >
        <apex:pageBlock title="Case List" id="Case_list">
         <apex:repeat value="{!NewCases}" var="cs">
         <table style="width:1000px;">
          
<tr>
 <apex:repeat value="{!NewCases}" var="case">
        <apex:outputLink value="https://na16.salesforce.com/{!cs.Id}">{!cs.CaseNumber}</apex:outputLink>
         <apex:outputLink value="{!cs.CaseNumber}">{!cs.CaseNumber}</apex:outputLink>
        </apex:repeat> 
             </tr>
        </table>
             </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>

and for NewCaseListController

public with sharing class NewCaseListController {

    public List<Case> getNewCases()

     {
       List<Case> results =Database.query('SELECT ID, CaseNumber FROM Case LIMIT 10');

       return results;

    }
}

However i am getting an error saying Challenge Not yet complete... here's what's wrong: 
The outputLink component is not binding to the ID of a case

Please help
Magesh Mani YadavMagesh Mani Yadav
Hi dhruv,
I have updated your class and vf page
public class NewCaseListController {
    public List<Case> getNewCases(){
       List<Case> results = Database.query('SELECT Id, CaseNumber FROM Case where status=\'New\'');
    	return results; 
    }
}
 
<apex:page controller="NewCaseListController">
    <apex:form >
        <apex:pageBlock title="Case List" id="Case_list">      
              <apex:repeat value="{!NewCases}" var="case">
                  <apex:outputLink value="https://na16.salesforce.com/{!case.Id}">{!case.CaseNumber}</apex:outputLink><br/>
              </apex:repeat>       
        </apex:pageBlock>
    </apex:form>
</apex:page>

Try this will work for you.