AL icon indicating copy to clipboard operation
AL copied to clipboard

Event Request: Publisher in DeleteRelatedData on Item Table

Open Srbaxter52 opened this issue 8 years ago • 1 comments

In a modification we have a new subsidiary table to the Item table, it holds data similar to how the Item Vendor table works. If the item is deleted after data is entered into the subsidiary tables, we need the data in the subsidiary tables to be deleted too. We notice that yMicrosoft has moved the code for deleting subsidiary table data to a local function called DeleteRelatedData in the item table.

We have found that if we add code to a subscriber of the OnAfterDelete publisher on the item table, to delete our subsidiary table data when the item is deleted, that works when you are actually deleting the item. However, the subsidiary data is also deleted when the item is processed by the Inventory Adjust Cost process, which is not what should happen.

Our observation is that when the code for deleting the subsidiary table data is in the DeleteRelatedData function, the subsidiary data is not accidentally deleted when the Inventory Adjust Cost process is run. When we add code for deleting data for our subsidiary table into the DeleteRelatedData, then our data is not accidentally deleted because of the Inventory Adjust Cost process.

We are requesting a “OnAfterDeleteRelatedData” publisher be added by Microsoft in the DeleteRelatedData function on the item table, so that we can move our code to a subscriber that uses the new publisher. We have tested this by creating a publisher in the DeleteRelatedData and it does not delete our data.

Srbaxter52 avatar Oct 25 '18 19:10 Srbaxter52

I'm curious - how did you bypass the issue templates which show that event requests are no longer accepted on this forum?

This repository is no longer dedicated to handling application bugs, application requests and application enhancements. Instead please use the following repository: https://github.com/Microsoft/ALAppExtensions

StanislawStempin avatar Oct 26 '18 06:10 StanislawStempin