---
schema_version: "1"
id: a63a17791846c0ca41908fd01b855552b0bea5e95479db87879c8a1da4eb4ba7
title: Interface RecordWithSubQueryResults
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-functions/functions/guide/javasdk/interfaces/java-recordwithsubqueryresults.md
canonical_url: https://developer.salesforce.com/docs/platform/functions/guide/java-recordwithsubqueryresults.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 86fc966f4c79d74446bc3591e22340c9ec42141c9464166c25202c435d88cf55
products:
  - Salesforce Functions
---
# Interface RecordWithSubQueryResults

All Superinterfaces: `Record`, `RecordAccessor`

---

\@Immutable public interface RecordWithSubQueryResults extends Record

Represents a Salesforce record with optional sub query results.

Implementations must be immutable and therefore thread-safe.

## Method Summary

| Modifier and Type             | Method                                  | Description                                               |
| ----------------------------- | --------------------------------------- | --------------------------------------------------------- |
| `Optional<RecordQueryResult>` | `getSubQueryResult​(String objectName)` | Returns the result of a sub query related to this record. |

### Methods inherited from interface com.salesforce.functions.jvm.sdk.data.RecordAccessor

`getBigDecimalField, getBigIntegerField, getBinaryField, getBooleanField, getByteField, getDoubleField, getFieldNames, getFloatField, getIntField, getLongField, getRecordField, getShortField, getStringField, getType, hasField, isNullField`

## Method Detail

### getSubQueryResult

\@Nonnull
Optional\<RecordQueryResult\> getSubQueryResult​(String objectName)

Returns the result of a sub query related to this record.

Records can have sub query results when the record is the result of a
relationship query.

Parameters: `objectName` - The object name of the sub query. Returns:
The result of a sub query related to this record.
