AL icon indicating copy to clipboard operation
AL copied to clipboard

Data gets deleted after the extension version is updated.

Open olisterr opened this issue 8 years ago • 9 comments

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.

olisterr avatar Jan 02 '18 05:01 olisterr

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

thpeder avatar Jan 02 '18 06:01 thpeder

Here's an example script: https://github.com/waldo1001/MostUselessAppEver/blob/master/PowerShell/App_UpgradeOnTEST.ps1

waldo1001 avatar Jan 02 '18 08:01 waldo1001

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).

jimmymcp avatar Jan 02 '18 10:01 jimmymcp

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.

JamesCrowter avatar Jan 02 '18 10:01 JamesCrowter

I also agree with this. We are losing a lot of time during development.

BartPermentier avatar Jan 02 '18 12:01 BartPermentier

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.

thpeder avatar Jan 02 '18 14:01 thpeder

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?

bwdeleeuw avatar Jan 02 '18 15:01 bwdeleeuw

It will be backported, but it will first be available in CU2.

thpeder avatar Jan 03 '18 09:01 thpeder

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

doivosevic avatar Feb 14 '18 10:02 doivosevic