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:

  1. Log in to Crudspace.io
  2. 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

  1. Click in the Query Editor Panel
  2. Begin typing your SOQL query
  3. Use autocompletion suggestions for objects and fields
  4. Utilize syntax highlighting to ensure proper query structure

Executing a Query

  1. Write your SOQL query in the editor
  2. Click the "Execute" button or press Ctrl+Enter (Cmd+Enter on Mac)
  3. View the results in the Results Panel
  4. Check the execution time and record count information

Working with Query Results

  1. Sort results by clicking on column headers
  2. Paginate through results using the navigation controls
  3. Adjust the number of records displayed per page
  4. Export results to CSV or JSON for further analysis

Saving and Loading Queries

  1. Write a query you want to save
  2. Click the "Save" button
  3. Provide a name for your query
  4. Access saved queries from the "Saved Queries" dropdown

Advanced Features

Intelligent Autocompletion

The SOQL Query Editor provides context-aware suggestions:

  1. Object names after FROM
  2. Field names after SELECT or in WHERE clauses
  3. Relationship fields with proper dot notation
  4. Function names and operators in appropriate contexts

Query Validation

The editor automatically validates your query:

  1. Syntax errors are highlighted in real time
  2. Error messages provide guidance on how to fix issues
  3. Warning indicators show potential performance issues

Query Formatting

Improve the readability of your queries:

  1. Click the "Format" button to automatically format your query
  2. Properly indent clauses and conditions
  3. 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