Get Default Values to Create a Record
The response contains the default field values for the Full layout type for a new record of the object type specified in {objectApiName}.
It also contains the corresponding layout for create mode. In the Salesforce user interface, an admin with “Customize Application” permission can mark a field as required in a layout. When you’re building UI, to determine which fields to mark as required in a layout for create mode, use the RecordLayoutItem.required property.
/ui-api/record-defaults/create/Account
- Resource
-
/ui-api/record-defaults/create/{objectApiName}
-
- objectApiName—The API name of the object type for the new record.
- Available Version
- 41.0
- HTTP Method
- GET
- Request Parameters
-
Parameter Name Type Description Required or Optional Available Version formFactor String The layout display size for the record. One of these values: - Large—(Default) Use this value to get a layout for desktop display size.
- Medium—Use this value to get a layout for tablet display size.
- Small—Use this value to get a layout for phone display size.
Optional 41.0 optionalFields String[] A collection of optional field names. If a field is accessible to the context user, it’s included in the response. If a field isn’t accessible to the context user, it isn’t included in the response, but it doesn’t cause an error. Specify names in the format ObjectApiName.FieldName. You can get any field that has a named relationship to this record. There’s no limit to the number of fields you can specify.
Optional 41.0 recordTypeId Id The ID of the record type (RecordType object) for the new record. If not provided, the default record type is used. Optional 41.0 - Response Body
- Record Defaults