web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

dynamics ax 2012: delete from inventTable

(1) ShareShare
ReportReport
Posted on by 1,264

Hello Community,

We want to delete records (more than 30000) from inventTable, we did that using the delete FROM instruction on the AOT.

the system was frozen for more than 3 hours. We decided to stop that action. Now when we open the released products list page, there is no item there, but when opening the inventTable from the AOT we find records in it.

How should we proceed in such a situation?

Thank you for your help

Kind regards

Jihane

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Hi Jihane,

    During the process also delete actions from the InventTable are executed and will delete related tables like records from InventTableModule. The released product forms will only show records with an innerjoin to some tables. So from some related tables the records are already deleted, but not the InventTable itself.

    Stopping the process was dangerous and now it appears it had an erroneous result. Probably you had taken a backup prior to this action (usually highly recommended) otherwise try to find a recent backup. You can then or fully restore or find the missing records in related tables.

    I wonder why if these items did had transactions. It is usually not possible to delete an item with transactions.

  • dolee Profile Picture
    11,279 on at

    In addition to Andre's reply, the delete method on InventTable is overriden in the Sys layer. That will degrade the DELETE_FROM action to a row by row operation. It helps explain the long execution time you experienced.

  • 5400 Profile Picture
    7,162 on at

    Hi Jihan,

    Deleting product data after transaction is very dangerous. did you delete through JOB or SQL. Logically, you can not delete the product data after transaction, system will stop you to delete the records. I am bit surprised how system was allowing  to delete records.

    See, you are not able to see the data in release product UI due to inner join dependency with other tables as said by andre.

    you want to delete the records from below tables to avoid the data integrity issue.

    1. Ecores product

    2. Invent Table

    3. Invent Table module ( sales,purch,invent)

    4. InventItemSypply

    5. InventItemInventSetup

    6. InventItemPurchSetup

    7.InventItemSalesSetup

    8.EcoresProductIndentifier.

    If you are  so keen regarding inventory data model, you can take step to delete the records if it is very very important.

  • jihane Profile Picture
    1,264 on at

    Hello,

    thank you André, Dominic Lee and BhaskarBoy for your answers.

    Our items have no transactions. Baskar Boy we consider deleting records from the tables you mentioned, except for the EcoResPRoduct and the EcoResProductIdentifier. we would like to keep products after deletion, is it right to proceed to the deletion of items but keeping the products?

  • André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Hi Jihane,

    Please have a look at the delete actions in the AOT on the InventTable. There are much more tables to be considered. The tables provided by Bhakar are only those used at the released product form.

    I would recommend to write or a script with a while select and do a ttsbegin/commit per x records. In addition you can use the progress indicator. You can also consider to run this job for about 10000 - 25000 records per run. To speed up the process you can also write a class which would take full advantage of the batch framework, however using multiple threads could create database blocks.

    It is OK to keep the global products and delete released items. That is up to your decision.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans