# data delete record

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

## Description for data delete record

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.

## Aliases for data delete record

`force:data:record:delete`

## Flags

| Flag Name (Long)    | Flag Name (Short) | Description                                                                                                                                         |
| ------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--api-version`     | N/A               | **Type:** Value<br><br>Override the api version used for api requests made by this command                                                          |
| `--flags-dir`       | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                         |
| `--json`            | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                     |
| `--record-id`       | `-i`              | **Type:** Value<br><br>ID of the record you’re deleting.                                                                                            |
| `--sobject`         | `-s`              | **Type:** Value<br>**Required**<br><br>API name of the Salesforce or Tooling API object that you're deleting a record from.                         |
| `--target-org`      | `-o`              | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |
| `--use-tooling-api` | `-t`              | **Type:** Boolean<br><br>Use Tooling API so you can delete a record from a Tooling API object.                                                      |
| `--where`           | `-w`              | **Type:** Value<br><br>List of <fieldName>=<value> pairs that identify the record you want to delete.                                               |

## Examples for data delete record

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

```shell
sf data delete record --sobject Account --record-id 00180XX
```

Delete a record from Account whose name equals "Acme":

```shell
sf data delete record --sobject Account --where "Name=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":

```shell
sf data delete record --sobject Account --where "Name='Universal Containers' Phone='(123) 456-7890'" --target-org myscratch
```

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

```shell
sf data delete record --use-tooling-api --sobject TraceFlag --record-id 7tf8c
```
