data delete record

Deletes a single record from a Salesforce or Tooling API object.

Specify the record you want to delete with either its ID or with a list of field-value pairs that identify the record. If your list of fields identifies more than one record, the delete fails; the error displays how many records were found.

When specifying field-value pairs, 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 deletes a record from Salesforce objects by default. Use the –use-tooling-api flag to delete from a Tooling API object.

force:data:record:delete

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.
‑‑record‑id‑iType: Value

ID of the record you’re deleting.
‑‑sobject‑sType: Value
Required

API name of the Salesforce or Tooling API object that you’re deleting a record from.
‑‑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 delete a record from a Tooling API object.
‑‑where‑wType: Value

List of <fieldName>=<value> pairs that identify the record you want to delete.

Delete a record from Account with the specified (truncated) ID:

Delete a record from Account whose name equals “Acme”:

Delete a record from Account identified with two field values, one that contains a space; the command uses the org with alias “my-scratch”:

Delete a record from the Tooling API object TraceFlag with the specified (truncated) ID: