Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

(0) ShareShare
ReportReport
Posted on by 44

Hi Guys,

I've got something interesting while importing products using DIXF;

An error with "Attempted to save a record with an invalid type" pops up without too much track. When I  look into the EcoResProduct table I can see that item was really added but not released. 

and then I see that another item with a different product type with the same ItemId was there, Then I realized that the same I imported long to ago from a different company as a "Product Mater", and here in the actual case from a different company I am importing it as a just product type: "Product".

So my question is... since there are many many items with the same case.. and a im still missing to import from few more companies.. I would like to change the products table as a not Shared table.

SaveDataPerCompany = Yes.

If I change the system will automatycally assign the Product to the initial company it was created/imported to?, or I have to assing manually or will it make more problems/inconsistencies?

pastedimage1615303780141v1.png

thanks a lot for your time, I really appreciated

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

    Sure. I believe it will work without any issues. Please try with all products and check if they go through.

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

    Actually I have imported one and it works. It went automatically into the Released table with Item Id as the global and Product name with the sufix. I will Try with the rest And give you feedback :)

    thanks a lot before hand

    pastedimage1615388333038v1.png

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

    Hi Nestor,

    We have faced such situations while upgrading from AX 2009 when the system automatically assigned  '-##" characters for the product number since they were conflicting. I believe appending the Product number with the DataAreaId would make more sense as you would be able to identify the legal entity for which the product number is different.

    Please give it a try and see if the import goes through without issues.

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

    Hi Gunjan,

    I thinking very seriously about your solution. So you mean Leaving the same ItemId for all the global items but importing with a Company specific sufix for the DisplayProductNumber.

    would it work like that when importing?.. I will give it a try

    pastedimage1615384629013v1.png

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

    Hi Nestor,

    Axapta 3.0 would have had Item Ids only and the concept of Product Ids wasn't present. I am suggesting you keep the same Item Id (since InventTable is a DataAreaId specific table) and change the Product number. For an example, you are importing an Item with Id "A-001", but the  product number already exists and has a different product type than the one you are importing, you can rename the Product number to "A-001-USMF" (USMF being the DataAreaId here). The itemId remains the same i.e. "A-001".

    This way when you migrate the orders, you won't face any issues.

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

    Hi Gunjan,

    thanks for your reply

    I still need to migrate open sales and purchases ... and each companies is creating new item every day.

    the old system (Axapta 3.0) is already working like that.. every company has his own item. And we name them acording to our clients Id number from their purchases so is easier for us to track them since we have more than 30.000 items...

    by know I would like to test it out with SaveDataPerCompany = Yes.

    Do you know if Ax automatically segregate them to their original DataAreaId?

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Cannot execute the required database operation. Attempted to save a record with an invalid type. Import Products in AX2012

    Hi Nestor C,

    I don't think you should change the EcoReProduct table to have "SaveDataPerCompany" property set as "Yes". This may cause issues for you as it is used across the application. If a product already exists in the system with the same Id, you could probably detect it before writing to target and change the Id to something like <dataAreaId> - <ProductId>.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans