Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > The conflict occurred in database, column 'ShippingOptionID'. View modes: 
User avatar
Member
Member
fs_cz - 3/21/2011 3:44:34 PM
   
The conflict occurred in database, column 'ShippingOptionID'.
Good evening,

I have a little problem with checkout process on GlobalAdministrator user. In e-commerce configuration, i´ve deleted some delivery possibilty. And then, when I was trying to buy some product, there was an Server Erro in / Application! It looks like this:


[DataConnection.ExecuteQuery]: Query: UPDATE COM_Customer SET [CustomerFirstName] = @CustomerFirstName, [CustomerLastName] = @CustomerLastName, [CustomerEmail] = @CustomerEmail, [CustomerPhone] = @CustomerPhone, [CustomerFax] = @CustomerFax, [CustomerCompany] = @CustomerCompany, [CustomerUserID] = @CustomerUserID, [CustomerPreferredCurrencyID] = @CustomerPreferredCurrencyID, [CustomerPreferredShippingOptionID] = @CustomerPreferredShippingOptionID, [CustomerCountryID] = @CustomerCountryID, [CustomerEnabled] = @CustomerEnabled, [CustomerPrefferedPaymentOptionID] = @CustomerPrefferedPaymentOptionID, [CustomerStateID] = @CustomerStateID, [CustomerGUID] = @CustomerGUID, [CustomerTaxRegistrationID] = @CustomerTaxRegistrationID, [CustomerOrganizationID] = @CustomerOrganizationID, [CustomerDiscountLevelID] = @CustomerDiscountLevelID, [CustomerCreated] = @CustomerCreated, [CustomerLastModified] = @CustomerLastModified WHERE [CustomerID] = @CustomerID: caused exception: The UPDATE statement conflicted with the FOREIGN KEY constraint "FK_COM_Customer_CustomerPreferredShippingOptionID_COM_ShippingOption". The conflict occurred in database "msware_www", table "dbo.COM_ShippingOption", column 'ShippingOptionID'.
The statement has been terminated.


Is there any way how to fix this problem?
It is little bit strange, becouse on others user accounts checkout process works without problems...

I got an idea about some SQL command to Site Manager - Develepment - System Tables - Ecommerce customer - delete, but I´m noob and I worry about it.

Thank you for answers!

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 3/24/2011 8:17:40 AM
   
RE:The conflict occurred in database, column 'ShippingOptionID'.
Hi,

It seems that in this particular instance, some Customer has seleted the Shipping option you want to delete as his Preferred Shipping option, hence it cannot be deleted (it violates the DB constraint).
To delete that option, you will need to find where else is this ShippingOption used (in DB via ShippingOptionID key) and remove those occurrences..

If you have access to the database, it could be possible to use appropriate SQL queries, e.g.
SELECT * FROM COM_Customer WHERE CustomerPreferredShippingOptionID = <id of the shipping option that is wanted to be deleted>

Hope this will help.

Regards,
Zdenek C