Open JohnnyUndercover opened 4 months ago
Hi @JohnnyUndercover,
while I get your scenario, your solution does sound more like a workaround than like a proper solution.
Allow me to discuss internally.
Completely agree. Would be nice to be able to run uprade code without reinstalling the app.
BC Idea Link
https://experience.dynamics.com/ideas/idea/?ideaid=5fd11dbc-914d-ef11-b4ac-6045bd8476a6
Description
From the Idea From time to time we have features that replace existing features. If we enable the new feature we need to transfer data from the old tables and fields to the new ones.
We want to be able to trigger the upgrade from the ui, similar to the functionality in the feature managemnt page.
But if we do the upgrade with normal al code (using repeat until) the upgrade is pretty slow and if somthing goes wrong we are in a bad position..
The solution would be faster upgrade code. We can achive this by using DataTransfer inside of Upgrade or Install Codeunits. But currently we cannot trigger this code from the UI (or throught AL Code).
Suggested solution that we can implement now
I suggest to add a new Procedure "ReinstallExtension" to the Extension Management Codeunit. The procedure would uninstall and then reinstall the extension. This would trigger the Install Codeunit of the extension. Inside of the Install Codeunit of the extension we can then check if we need to run our upgrade code or not and upgrade the data using DataTransfer.
I will provide the implementation for this BC Idea