You need to sign in to do that
Don't have an account?
Gabriel Martins 13
Unable to run SOQL on Visual Studio
Hello everyone, I'm facing an issue with the Visual Studio when trying to run any SOQL statment.
Step to reproduce:
1. Create a new file
2. Paste the SOQL statment: SELECT Name FROM Contact
3. Save the file with the extension .soql
4. Highlight the SOQL statment in the file
5. On comand Pallet Execute SFDX: Execute Anonymous Apex with Currently Selected TEXT
It does not work. I get the golowing error message: Unexpected token 'SELECT'.
Any idea?
thanks
When I tried SFDX: Execute Anonymous Apex with Currently Selected TEXT I was getting the above error but when I used this
SFDX: Execute SOQL Query with Currently Selected Text command I was able to retrieve the records can you try the soql with this command and see if it works.
>> You can also check this article: http://theblogreaders.com/visual-studio-code-tips-execute-soql-visual-studio-code/
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
All Answers
I also tried the same in my dev org and I see the same error let me check internally and respond.
Thanks,
Salesforce Support
When I tried SFDX: Execute Anonymous Apex with Currently Selected TEXT I was getting the above error but when I used this
SFDX: Execute SOQL Query with Currently Selected Text command I was able to retrieve the records can you try the soql with this command and see if it works.
>> You can also check this article: http://theblogreaders.com/visual-studio-code-tips-execute-soql-visual-studio-code/
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.