Developer forum

Forum » PIM » Creating variants from existing products

Creating variants from existing products

Mark Preisler
Reply

Hi 

Ran into a problem, when combining product in PIM to create variants. If a product already on a user’s favorite list the procedure for combining will fail with following error.

The UPDATE statement conflicted with the REFERENCE constraint "DW_FK_EcomCustomerFavoriteProducts_EcomProducts". The conflict occurred in database "smartpagePIM", table "dbo.EcomCustomerFavoriteProducts".
The statement has been terminated.

 

 

Capture5.PNG

Replies

 
Merethe Vrå Andersen Dynamicweb Employee
Merethe Vrå Andersen
Reply

Hi, 

Do you have more specific steps or a video that shows how you get the exception?

I have tried it based on your short description and it doesn't fail here (Using Rapido 3.1 with 9.6).
Video: https://www.screencast.com/t/WWQyPURUG2

Kind regards,
Merethe

 
Mark Preisler
Reply

Hey

It seem like both products have to be on the users favorite list, in order for det error to occur.

using
DW 9.5.2 
Rapido version 3.0

Capture1.PNG Capture2.PNG Capture3.PNG
 
Merethe Vrå Andersen Dynamicweb Employee
Merethe Vrå Andersen
Reply

Hi again,

Now I managed to reproduce the error and bugged it as # 63398. But... We'll check how this is to fix. It should be noted that it's not recommended to combine products that's already "in production". The data structure should be in place before releasing them to frontend. When combining - new product id's for the variants are created - and that can be the cause to the failure.

Kind regards,
Merethe

 
Alexey Tanchenko Dynamicweb Employee
Alexey Tanchenko
Reply

Hi, 

Fix is planned to further release.
For now you can use the workaround by executing this SQL on your database:

ALTER TABLE [EcomCustomerFavoriteProducts] DROP CONSTRAINT [FK_EcomCustomerFavoriteProducts_EcomProducts]
GO
ALTER TABLE [EcomCustomerFavoriteProducts] WITH CHECK ADD CONSTRAINT [FK_EcomCustomerFavoriteProducts_EcomProducts] 
FOREIGN KEY([ProductID], [ProductLanguageID], [ProductVariantID])
REFERENCES [EcomProducts] ([ProductID], [ProductLanguageID], [ProductVariantID])
ON DELETE CASCADE
ON UPDATE CASCADE
GO

 

 
Mark Preisler
Reply

Thanks.

 
Mark Preisler
Reply

Hey

 

When will this problem been resolved ?

Still getting same error in DW 9.8.0

 
Mark Preisler
Reply

Bump

 
Helene Kjærbøl
Reply

+1

 
Søren Ravn Lund
Reply

Bump

 
Alexey Tanchenko Dynamicweb Employee
Alexey Tanchenko
Reply
This post has been marked as an answer

Hi, 

 

The problem has been fixed. Should be released in Dynamicweb 9.9.5

Votes for this answer: 1

 

You must be logged in to post in the forum