Newer Version Available
Get Default Values to Create a Record
Get the default values for fields for a new record of a specified
object and optional record type. After getting the default values, make a request to POST /ui-api/records to create the 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.
The response contains object metadata for the object specified in {objectApiName} and for any nested objects. For example, this request returns object metadata for Account and User, because the OwnerId field on the Account object contains a reference to the User object.
1/ui-api/record-defaults/create/Account- Resource
-
1/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