Hi All, this is Trail Head https://trailhead.salesforce.com/content/learn/projects/quickstart-vscode-salesforce/use-vscode-for-salesforce# Code :
public with sharing class AccountController {
public static List<Account> getAllActiveAccounts() {
return [SELECT Id,Name,Active__c FROM Account WHERE Active__c = 'Yes'];
}
}
Getting Error : Unexpected token 'SELECT'.
Help me out how to resolve this...
Ah looks like you might be running the wrong command in the command palette.
Can you double check that you're running this one?
SFDX:Execute SOQL Query with Currently Selected Text
and not...
SFDX:Execute Anonymous Apex with Currently Selected Text
From the image you supplied it looks like you are running the "Anonymous Apex" one, which in incorrect.