SOQL Query Editor
Write and execute SOQL queries with syntax highlighting and autocompletion in Crudspace.io
SOQL Query Editor
The SOQL Query Editor in Crudspace.io provides a powerful interface for writing, validating, and executing Salesforce Object Query Language (SOQL) queries. This feature helps developers and administrators retrieve data from their Salesforce org with ease.
Overview
SOQL is used to search your organization's Salesforce data for specific information. The SOQL Query Editor offers:
- Syntax highlighting for better readability
- Intelligent code completion
- Field and object suggestions
- Query validation
- Results visualization
- Export capabilities
Accessing the SOQL Query Editor
To access the SOQL Query Editor:
- Log in to Crudspace.io
- From the left sidebar, click on "Query Editor"
Interface Components
Query Editor Panel
The top section provides a full-featured code editor where you can:
- Write and edit SOQL queries
- Get real-time syntax highlighting
- Receive intelligent autocompletion suggestions
- See syntax error indicators
Results Panel
The bottom section displays query results with:
- Tabular data view
- Column sorting capabilities
- Pagination for large result sets
- Record count information
Control Panel
The toolbar offers options to:
- Execute the current query
- Clear the editor or results
- Export results to CSV or JSON
- Save queries for later use
- Format queries for better readability
Working with SOQL Queries
Writing a Query
- Click in the Query Editor Panel
- Begin typing your SOQL query
- Use autocompletion suggestions for objects and fields
- Utilize syntax highlighting to ensure proper query structure
Executing a Query
- Write your SOQL query in the editor
- Click the "Execute" button or press Ctrl+Enter (Cmd+Enter on Mac)
- View the results in the Results Panel
- Check the execution time and record count information
Working with Query Results
- Sort results by clicking on column headers
- Paginate through results using the navigation controls
- Adjust the number of records displayed per page
- Export results to CSV or JSON for further analysis
Saving and Loading Queries
- Write a query you want to save
- Click the "Save" button
- Provide a name for your query
- Access saved queries from the "Saved Queries" dropdown
Advanced Features
Intelligent Autocompletion
The SOQL Query Editor provides context-aware suggestions:
- Object names after
FROM - Field names after
SELECTor inWHEREclauses - Relationship fields with proper dot notation
- Function names and operators in appropriate contexts
Query Validation
The editor automatically validates your query:
- Syntax errors are highlighted in real time
- Error messages provide guidance on how to fix issues
- Warning indicators show potential performance issues
Query Formatting
Improve the readability of your queries:
- Click the "Format" button to automatically format your query
- Properly indent clauses and conditions
- Add appropriate line breaks for complex queries
Advanced SOQL Features Support
The editor supports advanced SOQL features including:
- Aggregate functions (COUNT(), SUM(), etc.)
- Group By clauses
- Having conditions
- Subqueries
- Relationship queries
- LIMIT and OFFSET clauses
SOQL Best Practices
- Select Specific Fields: Avoid
SELECT *and only request fields you need - Filter Appropriately: Use WHERE clauses to limit returned records
- Limit Result Size: Use LIMIT to prevent retrieving too many records
- Consider Relationships: Be aware of how relationships affect query complexity
- Watch Query Performance: Monitor execution time for queries
Common SOQL Examples
Basic Query
SELECT Id, Name, Type, Industry
FROM Account
WHERE Industry = 'Technology'
LIMIT 10
Relationship Query
SELECT Account.Name, (SELECT FirstName, LastName FROM Contacts)
FROM Account
WHERE Type = 'Customer'
Aggregate Query
SELECT COUNT(Id) TotalOpportunities, StageName
FROM Opportunity
GROUP BY StageName