You need to sign in to do that
Don't have an account?

Trailhead Creating and using Custom Controllers Challenge Issue
I'm getting the error "The outputLink component is not binding to the ID of a case" for this challenge. I've checked several threads on here and I'm almost certain it should be correct. It does link to the details page for the case.
I initially just had the ID linking but have changed it so both case number and id link via id in case that mattered.
I've also previously tried having a complete url as the value but no luck.
Any help would be appreciated.
<apex:page controller="NewCaseListController">
<apex:pageBlock title="New Case List" id="cases_list">
<apex:repeat value="{! newcases }" var="cases">
<apex:outputLink value="/{! cases.id}">
ID: {! cases.id }
</apex:outputLink><br/>
<apex:outputLink value="/{! cases.id}">
Case Number: {! cases.CaseNumber }
</apex:outputLink><br/>
</apex:repeat>
</apex:pageBlock>
I initially just had the ID linking but have changed it so both case number and id link via id in case that mattered.
I've also previously tried having a complete url as the value but no luck.
Any help would be appreciated.
<apex:page controller="NewCaseListController">
<apex:pageBlock title="New Case List" id="cases_list">
<apex:repeat value="{! newcases }" var="cases">
<apex:outputLink value="/{! cases.id}">
ID: {! cases.id }
</apex:outputLink><br/>
<apex:outputLink value="/{! cases.id}">
Case Number: {! cases.CaseNumber }
</apex:outputLink><br/>
</apex:repeat>
</apex:pageBlock>
<apex:repeat var="case" value="{!NewCases}">
All Answers
Can you paste here Controller Code..
I am trying with below code its working fine..
Vf:-
<apex:page controller="Test">
<apex:pageBlock >
<apex:outputLink value="/{!c.Id}" >Back</apex:outputLink>
</apex:pageBlock>
</apex:page>
Controller:-
public with sharing class Test { public Case c {get;Set;} public Test(){ c = [select id from case limit 1]; } }
Thanks..
public class NewCaseListController {
public List<Case> getNewCases() {
List<Case> results = Database.query(
'SELECT id, CaseNumber ' +
'FROM Case ' +
'WHERE Status=\'New\''
);
return results;
}
}
But just to stress, its the Challenge check on the Trailhead that is failing with the message "The outputLink component is not binding to the ID of a case". The page loads fine for me and the links do redirect to the case details page.
I try with this code its work fine..
Thanks..
<apex:repeat var="case" value="{!NewCases}">
The following passes the challenge:
Hope this helps.
The VF page:
The controller:
After speding quite a bit of time on this myself.
1. The repeat component needs:Value, Var and ID.
2. Filter on New to 'WHERE Status = \'New\' '
So thats is how would work and pass the badge:
VISUALFORCE PAGE NewCaseList
CUSTOM CONTROLLER NewCaseListController
Tada!
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: unexpected token: Status
What is the logic for add the \'NEW\' ' for status instead some else like ' Status = "NEW" ' ?
Help and Clarification welcomed
Even I am facing the same issue as Benjamin is facing. Could someone please help ?
Thanks
Deepak
<apex:page controller="NewCaseListController">
<apex:repeat value="{!NewCases}" var="case" id="case">
<apex:outputLink value="{!case.id}"/><br/>
</apex:repeat>
</apex:page>
AND
Apex class:
public class NewCaseListController {
public List <Case> getNewCases(){
List<Case> results = Database.query(
'SELECT Id, CaseNumber, Status ' +
'FROM Case ' +
'WHERE STATUS =\'New\''
);
return results;
}
}
however the Challenge fails.
Coding instead passes the Challenge, but, the links fail (on my system at this time); they display a page which only contains the message "The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores. " Since a previous unit used the URLFOR($Action... technique in this situation, perhaps the challenge evaluation may be at fault here.
public class NewCaseListController {
public List<case> getNewCases(){
list<case> c=[select id,casenumber from case where status='new'];
return c;
}
}
<apex:page controller="NewCaseListController" >
<apex:pageBlock title="New Case List" id="cases_list">
<apex:repeat Value="{!newcases}" var="case">
<apex:outputLink value="{/!case.id}"> ID: {! case.id } </apex:outputLink> <t></t>
<apex:outputLink value="{/! case.id}">Case Number: {! case.CaseNumber }</apex:outputLink><br/>
</apex:repeat>
</apex:pageBlock>
</apex:page>
Hello All,
I have written the following code but it still gives me error.
May i know the mistake i am doing and how can i rectify ?
Error:
The outputLink component on the 'NewCaseList' page isn't binding to the ID of a case.
Code:
VF Code:
Controller:
Output :

Thanks in advance.