Events on uninstalling an extension
Hi,
we would love to have events raised when a user installs or uninstalls an extension.
On installing we could prepare data or user guidance a on uninstalling we could make sure we remove data the Extension had at some Point put into NAV tables.
This is a very cool idea
Thank you for the suggestion. We are actively considering the installation event. Uninstallation requires more investigation as it potentially impact the infrastructure if the data removal during uninstall fails for some reasons.
@StanislawStempin did you come up with a solution to subscribing on install or uninstall events?
Installation events have been added as described here: https://docs.microsoft.com/da-dk/dynamics-nav/developer/devenv-extension-install-code
Uninstall event is still on the backlog.
We would also need either some events for uninstalling an extension or - at a minimum - access to "NAV App", if we wanted to subscribe to the "OnAfterAction" events for the Extension Management and Extension Detail pages.
However, the best option for this implementation would be a codeunit subtype "Uninstall" with the appropriate triggers that also indicate, if this was uninstalled via PowerShell or UI.
The use case for this is that - when you use, for instance, workflows to block orders, there is no way to remove the blocking conditions via code and when the extension is uninstalled, the system is left in an inconsistent state: Orders are blocked via workflows that then won't execute anymore, because the code is missing.
Please also look #1271
Are there any updates on this functionality coming into play? We have a requirement for making changes during uninstalling
@StanislawStempin is the any solution on this yet or any workaround? As @pzentner mentioned, the workflows get stuckt when uninstalling our extension and leave the database in an inconsistent state.
@StanislawStempin Is there any update on the UninstallApp event? I also have a situation with Workflows and Data Exchange Framework where this would be very useful.
I am going to close this suggestion as requests are tracked on http://aka.ms/bcideas. In this case there is already an entry for this topic, so please vote on that: https://experience.dynamics.com/ideas/idea/?ideaid=2ee9e0ed-6cc5-e911-b083-0003ff68ac6b
As a side note, while the request makes sense, there are technical issues with supporting it, as any code running as part of the uninstall process could impact upgrade and require transactional rollback as well as sync across extensions (e.g., multiple extensions desiring access to the same data being remove by others), complicating it.