-
Notifications
You must be signed in to change notification settings - Fork 0
The Soql.Subquery Class
Jason Siders edited this page Jul 4, 2025
·
6 revisions
Represents child relationship queries within the broader query structure. Used to return child objects related to the primary object.
This class implements Soql.Selectable, and can be used in conjunction with the addSelect builder method.
The object uses the Soql.Builder class to allow for flexible query construction. Once your query is built, call toSubquery() to build the query as a Soql.Subquery object:
SELECT Id, (SELECT Id FROM Contacts) FROM AccountSoql.Subquery sub = new Soql.Subquery(Contact.AccountId);
Soql soql = Database.Soql.newQuery(Account.SObjectType).addSelect(sub)?.toSoql();This class inherits the Soql.Builder's query building methods, documented here.
Soql.Subquery(Schema.ChildRelationship relationship)Soql.Subquery(SObjectField lookupFieldOnChildObject)
- 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