Hi,
I've created an extension having table. I've also added the upgrade codeunit but after installing the extension through the Visual Studio Code, the data gets deleted related to the extension.
Hi,
If you want to run your upgrade code you need to use the Powershell commands, since when publishing with VSCode it uses SyncMode Clean internally.
You can read more about it here: https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-upgrading-extensions
Here's an example script: https://github.com/waldo1001/MostUselessAppEver/blob/master/PowerShell/App_UpgradeOnTEST.ps1
Would it be possible to determine how extension data is handled by VS Code with a preference setting somewhere? It would good to have to option to preserve the data (as if you were doing a regular uninstall, unpublish, publish, install).
I'll second that jimmymcp's request for an app.json setting for this, we're spending lots more time than we need to, because of this default behaviour at the moment.
I also agree with this. We are losing a lot of time during development.
We have just implemented that feature, so you can publish the same extension multiple times without losing the data.
It will be available in the January update.
That is great news, that would solve #62, #310, #462 #555, #722, #1079, #1198.
However, I noticed you mentioned feature instead of fix, and I wanted to confirm that this will be backported into NAV 2018, as mentioned in #722 by @StanislawStempin. Will that make it into CU1 on time?
It will be backported, but it will first be available in CU2.
This feature has been implemented and you can read more about it here:
https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-retaining-data-after-publishing
Most helpful comment
We have just implemented that feature, so you can publish the same extension multiple times without losing the data.
It will be available in the January update.