Try our conversational search powered by Generative AI!

Unable to create prices after updating a variant's code

Found in

EPiServer.Commerce 11.0.0

Fixed in

EPiServer.Commerce 11.2.4

(Or a related package)

Created

Sep 14, 2017

Updated

Sep 22, 2017

Area

Core

State

Closed, Fixed and tested


Description

Steps to reproduce:

  1. Go to the Catalog UI.
  2. Open a variant.
  3. Update the code.
  4. Don't publish.
  5. Go to the Prices tab.
  6. Try to add one price.
  7. Get Server error in browser console:
    Server Error in '/' Application.

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_PriceDetail_CatalogEntry". The conflict occurred in database "Quicksilver.Commerce", table "dbo.CatalogEntry", column 'Code'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_PriceDetail_CatalogEntry". The conflict occurred in database "Quicksilver.Commerce", table "dbo.CatalogEntry", column 'Code'.

Source Error:

Line 222: savedPrices = new List<IPriceDetailValue>();Line 223:Line 224: using (var reader = command.ExecuteReader())Line 225: {Line 226: // first result table: all inserted or updated values

Source File: C:\source\commerce\ECF\Mediachase.Commerce\Pricing\Database\PriceDetailDatabase.cs Line: 224