-
Notifications
You must be signed in to change notification settings - Fork 0
The Soql.InnerQuery Class
Jason Siders edited this page Jul 4, 2025
·
8 revisions
Represents inner query logic, used for filtering results in a WHERE clause. Use this in conjunction with the addWhere SOQL method.
This object uses the Soql.Builder class to allow for flexible query construction. Once your query is built, call toInnerQuery() to build the query as a Soql.InnerQuery object:
SELECT Id
FROM Account
WHERE Id IN (
SELECT AccountId
FROM Opportunity
WHERE IsWon = true
)Soql.InnerQuery innerQuery = new Soql.InnerQuery(Opportunity.SObjectType)
?.addSelect(Opportunity.AccountId)
?.addWhere(Opportunity.IsWon, Soql.EQUALS, true)
?.toInnerQuery();
Soql soql = Database.Soql.newQuery(Account.SObjectType)
?.addWhere(Account.Id, Soql.IN_COLLECTION, innerQuery)
?.toSoql();InnerQuery(SObjectType objectType)
This class inherits the Soql.Builder's query building methods, documented here.
- Generating Test Records
- Dml
- Soql
- Cmdt
- Plugins
- DatabaseLayer
- Dml
- MockDml
- MockRecord
- Cmdt
- MockCmdt
- MockSoql
-
Soql
- Soql.AggregateResult
- Soql.Aggregation
- Soql.Binder
- Soql.Builder
- Soql.Condition
- Soql.ConditionalLogic
- Soql.Criteria
- Soql.Cursor
- Soql.Function
- Soql.InnerQuery
- Soql.InvalidParameterValueException
- Soql.LogicType
- Soql.NullOrder
- Soql.Operation
- Soql.Operator
- Soql.ParentField
- Soql.PreAndPostProcessor
- Soql.QueryLocator
- Soql.Request
- Soql.Scope
- Soql.Selectable
- Soql.SortDirection
- Soql.SortOrder
- Soql.Subquery
- Soql.TypeOf
- Soql.Usage
- Soql.WhenClause