| Argument | Description | Types / Required |
| dataId | The resource ID returned by Data.open, or a dictionary name. | number, string
recommended |
| key | The key (case IDs) of a case. | string
not required |
| uuid | The UUID of a case. | string
not required |
| position | The "position" of a case. | number
not required |
The
Data.deleteCase action deletes a case from a
data source. Some data sources mark the case for deletion but keep it in the data source (e.g.,
CSPro DB), while other data sources delete the case entirely and it cannot be restored (e.g.,
Text).
The data source is identified using
dataId. If specified as a string, it references the data source that is connected to a dictionary that is part of an application. If specified as a number, it is processed as a
resource ID returned by
Data.open. This typically references non-application data sources. While optional, this should generally be specified explicitly. (If there is only one data source open, the resource ID can be calculated implicitly.)
- key: When specifying a key (case IDs), only non-deleted cases are matched.
- uuid: Specifying a case's UUID allows matching on all cases, including deleted cases. Note that not all data sources use UUIDs.
- position: Identification by the "location" of the case in the data source also matches on all cases. Note that the position value can change when the data source is modified.
One of these case identifiers must be specified. If multiple identifiers are specified, uuid is prioritized over position, which is prioritized over key.
Another way that cases end up deleted is by using
Data.writeCase with a case where the
"deleted" flag is set to
"true".
The action returns undefined.
The action throws an exception if any of its arguments are not specified in a valid form, or if:
- The data source ID is not valid.
- The data source was not opened in read and write mode.
- The specified case does not exist in the data source.
- There is an error interacting with the data source.
const dataId = /* retrieved from a call to CS.Data.open */;
CS.Data.deleteCase({
dataId: dataId,
key: "010117100811280231"
});