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.
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?
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.
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.
Thanks for your response.
There is no other way to identify deleted records. May be after joining couple of tables?
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156