How to fix STANDARD_PRICE_NOT_DEFINED in Salesforce deployments
A record needs a Standard Price Book entry for the product, but none has been created yet.
Surfaces during: runtime DML on pricing objects, in CPQ migrations and product setup scriptsWhat it means
STANDARD_PRICE_NOT_DEFINED means an operation, usually adding a product to a custom price book, or referencing it on a Quote or Opportunity Line, requires the product to already have a Standard Price Book entry, and one doesn't exist. Salesforce treats the Standard Price Book entry as the baseline every custom price book entry is built from.
This ordering requirement is a Salesforce platform rule, not a CPQ-specific one, so it applies whether products are created through the standard UI, Data Loader, or a CPQ package's own provisioning tools.
Common causes
The fix
- Insert the Standard Price Book entry firstAlways create a product's Standard Price Book entry before adding it to any custom price book.
Id standardPbId = Test.getStandardPricebookId(); insert new PricebookEntry( Pricebook2Id = standardPbId, Product2Id = productId, UnitPrice = 100, IsActive = true ); - Sequence pricing migrations in the right orderOrder the migration so standard entries are created in a separate, earlier step from custom price book entries.
- Audit for products missing standard entriesAfter a migration, query for products with custom price book entries but no Standard Price Book entry and backfill them.
How Serpent prevents this
Serpent sequences data-dependent objects the same way it sequences metadata dependencies, so a CPQ migration inserts Standard Price Book entries before any custom price book entries that depend on them. See the Salesforce deployment error library.

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