Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Cannot create a record in Products (EcoResProduct). Product number: ####### : : : # :, product_name. The record already exists. Importing Variants AX2012

Posted on by 529

Hi All,

I am having issues importing Variants[Color] trough DIXF in AX2012. Some variants are being imported correctly and some are not.

Error e.g: Cannot create a record in Products (EcoResProduct). Product number: 15899011 : : : D :, toppainting8888 R.
The record already exists.

When looking trough the issue.. in the EcoResProduct table everything is imported as well as in the EcoResDistinctProductVariant table . but I don't understand why some items have their Variant[Color] properly referenced and some just not. 

real example import :

from DIXF (two different items+variants):

pastedimage1615622729545v1.png

From EcoResProduct

pastedimage1615623083524v3.png

pastedimage1615623171513v4.png

Both seems like they were imported just the same way (looks normal). but when I open the Variants(Color[Rev.]) form  from the the Released Product Form; the 15949005 :  :  : B : is not showing any reference to the B color. I don't get it why

How is that is was already imported as the error says ? just don't get it... your help woulb be really appreciated

pastedimage1615623444943v5.png

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,269 Super User 2024 Season 2 on at
    RE: Cannot create a record in Products (EcoResProduct). Product number: ####### : : : # :, product_name. The record already exists. Importing Variants AX2012

    Hi Nestor,

    Unfortunately, I don't have an AX 2012 machine to check the behavior. Usually, the entity key for the target entity will search for existing records and perform an update instead of insert. Have you used a code debugger for this situation?

  • CBNestor Profile Picture
    CBNestor 529 on at
    RE: Cannot create a record in Products (EcoResProduct). Product number: ####### : : : # :, product_name. The record already exists. Importing Variants AX2012

    Hi André,

    I understand. but I don't know how to import a big amount of items from different legal entities and still keep the reference.. Actually the ItemId is still the same accross all companies. but the product name I had to changed it with the suffix.

    unless I import all the items at once (without releasing) and by code x++ released to each companies... need to study that no idea right now...

    the Entities I used are:

    for Products (it releases the products as well):

    Product [DMFProductEntity] (the StandardInventColorId has to be imported from here here if you want the the variant to be correctly referenced afterwards )

    for Variants:

    Variant [DMFProductVariantEntity]

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,269 Super User 2024 Season 2 on at
    RE: Cannot create a record in Products (EcoResProduct). Product number: ####### : : : # :, product_name. The record already exists. Importing Variants AX2012

    Hi Nestor,

    Using the company as suffix will of course work for the import, but then you don't have a reference between the same product in multiple legal entities.

    Can you tell which exact DIXF entity or entities you used to import the data?

  • Suggested answer
    CBNestor Profile Picture
    CBNestor 529 on at
    RE: Cannot create a record in Products (EcoResProduct). Product number: ####### : : : # :, product_name. The record already exists. Importing Variants AX2012

    Hi André,

    The Items that were imported into EcoResProduct were actually items Imported from a different company long time ago. so actually the infolog was correct.. they records already existed, i did not thought about that. Sorry that I did not realized on time.

    The problem is that I am importing from an old Axapta 3.0 were the items are stored separately by company. where here in ax2012 this is Shared

    Since they are many items to be imported from each company (10.000/company) I cannot afford to release each one by hand.

    So I did a Rollback and I modified the DisplayProductName with a sufix of the company where the item is being imported from.

    so I had to import all the items and then variants again from fresh.. now it works

    pastedimage1615817282461v1.png

    P.S: Actually I don't now if this would be a good/best solution

  • CBNestor Profile Picture
    CBNestor 529 on at
    RE: Cannot create a record in Products (EcoResProduct). Product number: ####### : : : # :, product_name. The record already exists. Importing Variants AX2012

    Hi André, thanks for replying,

    1. Do you have multiple variants in your original file for the same product?

    R: at least from the example I uploaded: No. just one variant.

    But is normal that we can have different variants for the same Item/product, and different products have have the same ColorId , but I dont see any problem with that.

    2. Have you checked all indexes on the EcoResProduct table which allows duplicates or not?

    R: I have no customizations in the EcoResProduct table, I have not touched it

    pastedimage1615790970235v1.pngpastedimage1615791045138v2.png

    my sample file for import

    pastedimage1615791542029v3.png

    the strange part is that they look like they were imported correctly is just that they some of them are not referencing their ColorId 

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,269 Super User 2024 Season 2 on at
    RE: Cannot create a record in Products (EcoResProduct). Product number: ####### : : : # :, product_name. The record already exists. Importing Variants AX2012

    Hi Nestor,

    Do you have multiple variants in your original file for the same product? Have you checked all indexes on the EcoResProduct table which allows duplicates or not? There could be a custom one which does not allow for duplicates.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans