You need to sign in to do that
Don't have an account?
Michael Agres 2
Creating & Using Custom Controllers Trailhead Challenge -- error message
When I preview and try to check the challeng, I get this:
line 1:47 no viable alternative at character '"'
An unexpected error has occurred. Your development organization has been notified.
___
Here's my vf page:
... and here's my controller:
Not sure where on line 1 I'm drawing the blank (invisible) space/character.
Anyone else run into this?
line 1:47 no viable alternative at character '"'
An unexpected error has occurred. Your development organization has been notified.
___
Here's my vf page:
<apex:page controller="NewCaseListController"> <ul> <apex:pageBlock title="New Cases" id = "cases"> <apex:repeat value = "{!newCases}" var = "case"> <li> <apex:outputText value = "{!case.id}"/> <br/> <apex:outputLink value = "/{!case.id}">Click here!</apex:outputLink> </li> </apex:repeat> </apex:pageBlock> </ul> </apex:page>
... and here's my controller:
public class NewCaseListController { // stuff goes here public List<Case> getNewCases() { List<Case> results = Database.query( 'SELECT Id, CaseNumber FROM Case WHERE Status = "New" '); return results; } }
Not sure where on line 1 I'm drawing the blank (invisible) space/character.
Anyone else run into this?
All Answers
After spending some time on the above challenge I got the below code to work.
1. The repeat component needs: Value, Var, and ID.
2. Filter on New to 'WHERE Status = \'New\' '
So that's is how would work and pass the badge:
VISUALFORCE PAGE NewCaseList: CUSTOM CONTROLLER NewCaseListController: Hope this helps.
Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Thanks,
Nagendra
Refer this Controller code
Thanks
Atul Patil
Salesforce Developer