**Source URL:** https://quality.veevavault.help/en/lr/1216072/

# Managing Document Retention & Automatic Archival (QualityDocs)

Quality teams can identify documents reaching their retention end dates, initiate retention review workflows, and archive documents in bulk in Veeva QualityDocs, supporting proactive compliance and reducing the time and effort required to manually manage documents and document archival.

**Note**: You must enable document archiving in your Vault before configuring this feature.

## Creating Retention Schedules

You can set up global or local policies to enforce document retention periods automatically using _Quality Retention Schedule_ records. These reusable records define retention periods in years and can be assigned to documents by document _Owners_. _Quality Retention Schedule_ records are governed by the _Quality Retention Schedule_ lifecycle. _Quality Retention Schedule_ records must be in the _Approved_ state to be available for selection by users.

To create _Quality Retention Schedule_ records:

1. Navigate to **Business Admin > Objects > Quality Retention Schedule**.  
2. Click **Create**.  
3. Enter a **Name**.  
4. Enter a **Retention Period in Years**.  
5. Optional: Select a **Country**.  
6. Optional: Enter a **Description**.  
7. Click **Save** or click **Save + Create** to create additional retention schedules.

When users assign a retention schedule to a document, Vault creates a _Quality Document Retention Schedule_ join object record. 

### Updating Quality Retention Schedules

To update a _Quality Retention Schedule_ record, move the record back to the _Open_ state. Once you update a _Quality Retention Schedule_ record and move it to the _Approved_ state, Vault runs the _Sync Quality Document Retention Periods_ job to cascade the updated _Retention Period in Years_ value to any linked _Quality Document Retention Schedule_ records.

## Configuring Retention Schedule User Actions

Add the following user actions to the appropriate states in the _Draft to Effective_ lifecycle:

* **Assign Retention Schedule**  
* **Remove Retention Schedule**  
* **Start Retention Period**

Once configured, users can perform these actions on individual documents or in bulk. 

## Configuring Document Jobs & Workflow

The _Document Retention Job_ and _Document Archival Job_ are asynchronous and run daily by default.

### Document Retention Job

The _Document Retention Job_ identifies all documents with an upcoming retention end date, excluding documents under legal hold. 

By editing the job definition, you can activate the job and optionally configure the following settings:

* **Enable Document Retention Review & Approval Workflow**: Select this checkbox to automatically initiate the _Document Retention Review & Workflow_ on the _Quality Document Retention Schedule_ join object.  
  * **Select the number of days before the Document Retention End Date that the Document Retention Review & Approval Workflow should be initiated**: Enter a number between **`0`** and **`366`**. This determines the number of days before the _Retention End Date_ of a target document that Vault should initiate the _Document Retention Review & Approval_ workflow. This setting is available only when the _Enable Document Retention Review & Approval Workflow_ checkbox is selected.

When the _Enable Document Retention Review & Approval Workflow_ checkbox is selected, and you enter a number of days between zero and 366, the _Document Retention Job_ identifies active _Quality Document Retention Schedule_ records where the _Retention End Date_ minus the configured number of days is today or earlier. If these settings are not configured, the _Document Retention Job_ identifies active records where the _Retention End Date_ is today or earlier. Vault then sets the _Targeted for Archival_ and _Ready for Archival_ fields on these identified records to _Yes_.

If Vault is unable to process a _Quality Document Retention Schedule_ record, it populates the _Error/Not Started Reason_ field with an applicable error message. Users must clear this field for the _Document Retention Job_ to identify and reprocess the record in the future.

#### Doc Retention Schedule Review & Approval Workflow

If your configuration leverages the _Enable Document Retention Review & Approval Workflow_ checkbox setting on the _Document Retention Job_, you must also add an **Update Field** step to the _Doc Retention Schedule Review & Approval_ workflow to update the **Ready for Archival** field to **Yes** to allow the job to process the _Document Archival Job_ to process the document. If the document is not approved using the workflow, we recommend also configuring an **Update Field** step to set the **Targeted for Archival** field to **No** and to set a new **Retention End Date** in the future, allowing Vault to process the document in the future, once conditions are met.

### Document Archival Job

The _Document Archival Job_ identifies and archives all documents where the following conditions are true:

* _Ready for Archival_ (`ready_for_archival__v`) equals _Yes_   
* _Targeted for Archival_ (`targeted_for_archival__v`) equals _Yes_   
* _Retention End Date_ (`retention_end_date__v`) is in the past   
* _Error/Not Started Reason_ (`error_not_started_reason__v`) is blank  
* The document is not under legal hold

You can activate the job by editing the job definition. The _Document Archival Job_ inactivates _Quality Document Retention Schedule_ records when archiving the corresponding target documents by moving the record to the _Completed_ state type.

#### Enabling Document Deletion

You can optionally navigate to **Admin > Settings > Application Settings** and select the **Allow system to delete Quality Document Retention Schedule records when the corresponding target document has been deleted** checkbox to enable Vault to delete the records rather than inactivate them. Once enabled, you cannot disable this setting.

## Related Permissions

The following permissions control access for archiving documents and working with archived documents:

| Type | Permission Label | Controls |
| ----- | ----- | ----- |
| Security Profile | Object: Quality Retention Schedule: Create, Read, Edit, Delete | Ability to manage _Quality Retention Schedule_ records. |
| Security Profile | Object: Quality Document Retention Schedule: Create, Read, Edit | Ability to view the _Retention Schedule_ pane in the Quality Relationships panel, and to execute the user actions. |
| Security Profile | Jobs: Edit | Ability to edit the _Document Retention Job_ and _Document Archival Job_ definitions. |
| Document Role | Edit Fields | Ability to assign _Quality Retention Schedules_ to documents. |