---
title: "Error 0x80040265: Cannot Delete Due to References"
description: "Error 0x80040265: Cannot Delete Due to References"
keywords: "Error 0x80040265: Cannot Delete Due to References D365 Sales CRM Error Message"
url: "https://myrapidi.com/wiki/error_0x80040265_cannot_delete_due_to_references"
locale: "en"
published: "2026-02-05T10:00:14Z"
modified: "2026-02-05T10:00:14Z"
---

**Error Message** : "The object cannot be deleted because it is referenced by one or more other objects".  
**What it means** : Dynamics 365 prevents deletion because other records depend on this one. You must remove or reassign dependent records first.

**Common Scenarios**  

**| Scenario | Example | Cause | Solution |
| Account with Contacts | Cannot delete Account 'Contoso' because it has 15 related Contacts | Contacts reference the Account via Parent Customer field | Delete or reassign Contacts first |
| --- | --- | --- | --- |
| Product in Price List | Cannot delete Product because it exists in ProductPriceLevel records | ProductPriceLevel references Product | Remove from price lists first |
| Currency in Transactions | Cannot delete EUR currency because Quotes use it | Quotes, Orders, Invoices reference the Currency | Deactivate instead of delete |
| Quote with Orders | Cannot delete Quote because Orders were created from it | Orders reference originating Quote | Delete Orders first or close Quote |
| Custom Entity Cascade | Cannot delete custom parent record with related child records | Relationship configured as Restrict delete | Delete children or change cascade rules |**
  
**How to Fix**

**Step 1: Identify What's Blocking the Delete**

The error message usually includes which entity type is referencing the record. If not clear:

- Open the record in D365 UI: Look for related records in sub-grids
- Check entity relationships: Settings \> Customizations \> Entities \> Relationships
- Query related records: Use Advanced Find or API to find dependencies

**Step 2: Choose Your Strategy**

**Option A: Delete Dependent Records First (Cascade Delete)**

Best for: Test data, bulk cleanup, parent-child hierarchies

- Query all related records
- Delete child records first
- Then delete parent record

**Option B: Reassign References (Preserve Data)**

Best for: Production data, maintaining history

- Find all dependent records
- Update them to reference a different parent
- Then delete original record

**Option C: Deactivate Instead of Delete**

Best for: Master data (Currencies, Products, Price Lists)

- Set State to Inactive instead of deleting
- Preserves historical references
- Prevents use in new transactions

**Option D: Remove References (Clear Lookups)**

Best for: Optional lookup fields

- Set lookup field to null on dependent records
- Then delete the record
