• Kevin Richards
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Supplemental Dataset Team Lead

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hello Salesforce,

I'm working through the Trailhead modules and have encountered a problem with completing the "Introduction to Custom Controllers" module.
My solution:

public class NewCaseListController{

public List<Cases> getCases() {
     List<Cases> results = Database.query(        
    'SELECT Id, CaseNumber FROM Cases WHERE Status=New');
      return results;    
                  }
}
I get the error "Illegal assignment from List<SObject> to List<System.Cases> at line 4 column 18" and can't seem to resolve this issue.

Please assist.

Kevin
Hello Salesforce,

I'm working through the Trailhead modules and have encountered a problem with completing the "Introduction to Custom Controllers" module.
My solution:

public class NewCaseListController{

public List<Cases> getCases() {
     List<Cases> results = Database.query(        
    'SELECT Id, CaseNumber FROM Cases WHERE Status=New');
      return results;    
                  }
}
I get the error "Illegal assignment from List<SObject> to List<System.Cases> at line 4 column 18" and can't seem to resolve this issue.

Please assist.

Kevin