data create record

Create and insert a record into a Salesforce or Tooling API object.

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.

force:data:record:create

Flag Name (Long)Flag Name (Short)Description
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑sobject‑sType: Value
Required

API name of the Salesforce or Tooling API object that you’re inserting a record into.
‑‑target‑org‑oType: Value
Required

Username or alias of the target org. Not required if the target-org configuration variable is already set.
‑‑use‑tooling‑api‑tType: Boolean

Use Tooling API so you can insert a record in a Tooling API object.
‑‑values‑vType: Value
Required

Values for the flags in the form <fieldName>=<value>, separate multiple pairs with spaces.

Insert a record into the Account object of your default org; only the required Name field has a value:

Insert an Account record with values for two fields, one value contains a space; the command uses the org with alias “my-scratch”:

Insert a record into the Tooling API object TraceFlag: