createRecord(recordInput)
Creates a record.
createRecord
uses this User Interface API resource.
Parameter Name | Type | Description | Required? |
---|---|---|---|
recordInput | Object | A RecordInput object used to create the record. |
recordInput
takes two properties.
Property Name | Type | Description | Required? |
---|---|---|---|
apiName | String | The API name of a supported object. | |
fields | Object | Map of field names to field values. |
Passing in allowOnSaveDuplicate
or recordTypeId
isn't currently supported. To prevent the creation of duplicate records, use a duplicate rule with a matching rule.
A Promise object that resolves with the created record. The record contains data for the fields in the record layout.
Before you use this wire adapter, make sure that there isn’t an easier way to create the data. Consider using the lightning-record-*-form
components to work with records. To update a record, use updateRecord
instead.
Use createRecord
by passing in the record input. To create a RecordInput object, use generateRecordInputForCreate(record,objectInfo)
. Alternatively, pass in a recordInput
object with the apiName
and fields
properties.
See Also