Get Record Create Defaults Examples

AVAILABLE API VERSION
API v68.0 and later

This example gets the default field values for creating an account record. Use rawValue for scalar fields. Use a single inline fragment with the ... on Object syntax for reference fields.

The previous query returns this partial response.

This example gets the default field values for a new opportunity record with a reusable fragment to get the typed value for each field.

This example uses TEMPLATE mode with optionalFields to return defaults only for the specified fields on the opportunity object.

This example chains getting account create defaults with the account layout to minimize round trips. The two fields share multiple arguments, such as objectApiName and recordTypeId, and require consistency in query.

Get Record Create Defaults