How to fix CANNOT_CASCADE_PRODUCT_ACTIVE in Salesforce deployments
A Product2 record can't be deactivated or deleted because an active PricebookEntry still references it.
Surfaces during: DML on Product2 records, usually in a data migration or cleanup scriptWhat it means
CANNOT_CASCADE_PRODUCT_ACTIVE fires when an operation tries to deactivate or remove a Product2 record while it's still referenced by an active PricebookEntry. Salesforce won't cascade the change through dependent pricing records automatically, so the product stays blocked until the dependency is cleared explicitly.
It's a runtime data error, not a metadata deploy error: it happens the moment the DML statement runs, whether from Data Loader, an Apex data migration script, or a CPQ cleanup job, not during a Metadata API deployment.
Common causes
The fix
- Deactivate PricebookEntries firstUpdate or deactivate every PricebookEntry tied to the product before attempting to deactivate the Product2 record itself.
List<PricebookEntry> entries = [ SELECT Id FROM PricebookEntry WHERE Product2Id = :productId AND IsActive = true ]; for (PricebookEntry pbe : entries) pbe.IsActive = false; update entries; - Sequence CPQ migrations to detach dependents firstOrder data migration steps so bundle and price rule references are cleared before the parent product changes state.
- Check for active Quote Line or Order Product referencesConfirm no open Quote Lines or Order Products still point at the product before deactivating it.
How Serpent prevents this
Serpent's dependency-aware deployment sequencing applies to CPQ and pricing objects the same way it does to any other metadata, so a product deactivation and its pricebook entries move in the right order instead of colliding mid-deploy. See the Salesforce deployment error library.

Prevention
Related errors
CANNOT_CASCADE_PRODUCT_ACTIVE, answered
Start free. No credit card, no install, no commitment.
Set up in under 15 minutes. No DevOps hire needed.
