Skip to main content

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...

7 respuestas
  1. 5 ene 2022, 15:57

    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.

0/9000