• Sumant Satpathy
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi all,
quite easy question about Database.query method. I'm learning SF with trailhead.salesforce.com and I'm getting pretty strange error here. I'm using developer edition of SF so should be not problems with some code limits or restrictions here I hope.

https://trailhead.salesforce.com/trails/force_com_dev_beginner/modules/visualforce_fundamentals/units/visualforce_custom_controllers
 
public class ContactsListController {

    private String sortOrder = 'LastName';
    
    public List<Contact> getContacts() {
        
        List<Contact> results = Database.query(
            'SELECT Id, FirstName, LastName, Title, Email ' +
            'FROM Contact ' +
            'ORDER BY ' + sortOrder + ' ASC ' +
            'LIMIT 10'
        );
        return results;
    }

}

Error: Method does not exist or incorrect signature: void query(String) from the type Database

User-added image

Hi to all,

I want to know the differnce between Products and assets in salesforce?