In this blog, we would learn about the different places where we can build and execute SOQL. Also I have listed them according to the convenience each tool offers.
Workbench is a very powerful, web based tool designed to interact with Salesforce using Force.com APIs.
It gives you an option to sign-in using your production and sandbox credentials. It also prompts you to allow access when you do it the first time.
This tool is efficient and you do not have to worry about remembering API names of the fields. Simply select them, apply your filters and you are good to go!
How to access it? Log into your Org –> Click on the setting gear (top right) –> Click Developer Console.
You can type your SOQL into the Query Editor and simply execute it. The only pain is that you need to either remember or copy over the API name of field(s) from any object.
Visual Studio Code:
The other best way is to execute the SOQL in the VS Code. This is how you install it if you have not done it yet.
Simply jump into the scripts folder –> SOQL –> Type down your SOQL, select it and choose the option to run the query.
Typing down the query is a little easier here as VS Code supports the intellisense feature while you type.
To see the output returned from the SOQL, simply toggle to Output tab(usually at the bottom) and validate the information.
I hope this helps. 🙂