---
schema_version: "1"
id: 475706e499b27db5a918cda1685f67969246b56759f14c6a381eb78408380d8e
title: DeletedRecord Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_database_deletedrecord.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_database_deletedrecord.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 55bf4e19a76393f275f06015ae17dbcdc24250459cee991a6738bd98185a9d28
description: Contains information about a deleted record.Returns the deleted date of this record.Returns the ID of a record deleted within the time window specified in the Database.getDeleted method.
---
# DeletedRecord Class

Contains information about a deleted record.

## Namespace

[Database](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Database.htm "The Database namespace provides classes used with DML operations.")

## Usage

The getDeletedRecords method of the Database.GetDeletedResult class returns a list of Database.DeletedRecord objects. Use the methods in the Database.DeletedRecord class to retrieve details about each deleted record.

## DeletedRecord Methods

The following are methods for DeletedRecord. All are instance methods.

- **[getDeletedDate()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_database_deletedrecord.htm#apex_Database_DeletedRecord_getDeletedDate)**  
    Returns the deleted date of this record.
- **[getId()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_database_deletedrecord.htm#apex_Database_DeletedRecord_getId)**  
    Returns the ID of a record deleted within the time window specified in the Database.getDeleted method.

### getDeletedDate()

Returns the deleted date of this record.

#### Signature

public Date getDeletedDate()

#### Return Value

Type: [Date](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_date.htm#apex_methods_system_date "Contains methods for the Date primitive data type.")

### getId()

Returns the ID of a record deleted within the time window specified in the Database.getDeleted method.

#### Signature

public Id getId()

#### Return Value

Type: [ID](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_id.htm#apex_methods_system_id "Contains methods for the ID primitive data type.")