Create and insert a record into a Salesforce or Tooling API object.
Description for data create record
You must specify a value for all required fields of the object.
When specifying fields, use the format <fieldName>=<value>. Enclose all field-value pairs in one set of double quotation marks, delimited by spaces. Enclose values that contain spaces in single quotes.
This command inserts a record into Salesforce objects by default. Use the –use-tooling-api flag to insert into a Tooling API object.
Aliases for data create record
force:data:record:create
Flags
Flag Name (Long)
Flag Name (Short)
Description
‑‑api‑version
N/A
Type: Value
Override the api version used for api requests made by this command
‑‑flags‑dir
N/A
Type: Value
Import flag values from a directory.
‑‑json
N/A
Type: Boolean
Format output as json.
‑‑skip‑assignment‑rules
N/A
Type: Boolean
Don’t apply active assignment rules when creating the record; applies to Account, Case, and Lead records.
‑‑sobject
‑s
Type: Value Required
API name of the Salesforce or Tooling API object that you’re inserting a record into.
‑‑target‑org
‑o
Type: Value Required
Username or alias of the target org. Not required if the target-org configuration variable is already set.
‑‑use‑tooling‑api
‑t
Type: Boolean
Use Tooling API so you can insert a record in a Tooling API object.
‑‑values
‑v
Type: Value Required
Values for the flags in the form <fieldName>=<value>, separate multiple pairs with spaces.
Examples for data create record
Insert a record into the Account object of your default org; only the required Name field has a value:
1sf data create record --sobject Account --values "Name=Acme"
Insert an Account record with values for two fields, one value contains a space; the command uses the org with alias “my-scratch”:
1sf data create record --sobject Account --values "Name='Universal Containers' Website=www.example.com" --target-org my-scratch
Insert a record into the Tooling API object TraceFlag:
1sf data create record --use-tooling-api --sobject TraceFlag --values "DebugLevelId=7dl170000008U36AAE StartDate=2022-12-15T00:26:04.000+0000 ExpirationDate=2022-12-15T00:56:04.000+0000 LogType=CLASS_TRACING TracedEntityId=01p17000000R6bLAAS"