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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

If Order is cancelled then data is getting deleted from [dbo].[INVENTTRANS] and i want to Identify deleted record so that same can be deleted from Data Warehouse

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have noticed that if an Order is cancelled then data is getting deleted from [dbo].[INVENTTRANS] and I want to Identify deleted record so that same can be deleted from Data Warehouse (DWH).

For Example: I am pulling data (delta based on ModifiedDatetime) from [dbo].[INVENTTRANS] today and there are 1000 orders open that time.  Many of them getting cancelled by next pull and cancelled one getting deleted from [dbo].[INVENTTRANS]. As I have already pulled the open orders to Data Warehouse and many of the are cancelled and can't be found in AX so I want to deleted them from DWH.

Is there any way to identify deleted transactions in AX. We are using Microsoft Dynamics AX 2012.

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,386 Super User 2025 Season 2 on at
    RE: If Order is cancelled then data is getting deleted from [dbo].[INVENTTRANS] and i want to Identify deleted record so that same can be deleted from Data Warehouse

    Hi Shivendoo,

    One way would be enabling database log for deleted records. However, enabling it on the inventory transactions might cause performance issues.

    An alternative would be a development effort where you create a table with deleted records. This can be populated with coding the moment an inventory transaction record is deleted.

  • Community Member Profile Picture
    on at
    RE: If Order is cancelled then data is getting deleted from [dbo].[INVENTTRANS] and i want to Identify deleted record so that same can be deleted from Data Warehouse

    Thanks for your response.

    There is no other way to identify deleted records. May be after joining couple of tables?

  • Suggested answer
    Satish Panwar Profile Picture
    14,671 Moderator on at
    RE: If Order is cancelled then data is getting deleted from [dbo].[INVENTTRANS] and i want to Identify deleted record so that same can be deleted from Data Warehouse

    Hi Shivendoo,

    Unfortunately there is not delete capture. You best guess is custom table to store all deletes. In your scenario you mentioned, order cancellation, but also think through what happens when order line get deleted.

    InventTrans table is too complex to accommodate all scenario that may lead to record Rd creation/deletion. Another thought would be why use InventTrans in DW, leverage parent entity instead, bit do know you have se problem there too.

    Thanks,

    Satish Panwar

    Please take time to click yes against the answer that help guide you in right direction.

  • Aamir Shakeel Profile Picture
    190 on at
    RE: If Order is cancelled then data is getting deleted from [dbo].[INVENTTRANS] and i want to Identify deleted record so that same can be deleted from Data Warehouse

    You can write code on validateDelete method to save the record Id and transaction Id of those records which get deleted due to any reason in a separate table and use that table to get the required information of deleted data.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: If Order is cancelled then data is getting deleted from [dbo].[INVENTTRANS] and i want to Identify deleted record so that same can be deleted from Data Warehouse

    ValidateDelete is not the correct method to hook into. Delete method is the correct one. ValidateDelete is called when a process attempts to delete a record. If the validation fails, the record isn't deleted.

    Delete method is called during delete.

    I would consider storing order lines, receipt lines etc in the dw, instead of inventTrans which changes, gets deleted, split and merged all the time.

    Why did you choose to sync InventTrans in the dw?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,004

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 865 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 582 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans