Developer forum

Forum » Development » Problems after importing variantGroups

Problems after importing variantGroups

Aksel Andersen
Reply

Hi guys.

Im importing data from another system into the ecom db. Im generating the variant groups in code for so importing them.

There are two groups existing from before. (VARGRP1, VARGRP2), so i start my imported variantgroupID from 3 and so on.

The variants are showing correctly in Admin after the import, but i cant create new variantGroups from admin. I get this exception:

Violation of PRIMARY KEY constraint 'EcomVariantGroups$PrimaryKey'. Cannot insert duplicate key in object 'dbo.EcomVariantGroups'. The duplicate key value is (VARGRP3, LANG1).

Do i need to clear some cahce or something or is there a table i need to update to make this work?

 

Best regards

Aksel

 

 

 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Aksel

 

The IDs are generated based on information in the table eComNumbers - it has a field, [NumberCounter], that holds how far it is in the generation of IDs. You need to update that since you added VARGRP[n] to the variant Group table.

 

The easiest way would be to define your own ID key for you import, so instead of calling them VARGRP3 etc. call them someting you make up. That is why the keys Work like they do - so we create a key when needed, but when importing use whatever you want (Not too long and weird though).

 

BR Nicolai

Votes for this answer: 1
 
Aksel Andersen
Reply

Thanks for a quick reply Nicolai.

Knowing this makes things alot easier.. :)

 

Best regards

Aksel

 

 

 

 

 

 

 

You must be logged in to post in the forum