I have created an extension for an addons . While testing in my local system I have found some bug so in order to fix that I have to uninstall the extension but I have stored some data in my custom table which I don’t want to delete.
So in my upgrade codeunit where I have created one global function named OnNavAppUpgradePerCompany I have written below code
Thanks for your response. As you mention, I have checked data in SQL and yes data is there. For your reference I have attached screen shot below. Do I need to write a code in OnNavAppUpgradePerDatabase function instead of OnNavAppUpgradePerCompany?
has anyone else encountered this issue? basically I create an extension, publish and install it (single tenant setup) if I uninstall then re-install the same version all data in custom tables/fields and backed up and restored exactly as expected. I can even totally unpublish and re-install the same version and everything works as expected.
If however I perform an update to the extension and try to re-publish/re-install with a different version number (I.e. 1.0.0.1 - 1.0.0.2) the data is backed up correctly but the data IS NOT restored into the custom Tables/fields, the archive tables (dbo.$AppData$…) in SQL remain, I also don’t get an error on install about schema changes not being handled in upgrade codeunit. I’ve tried various methods of including the upgrade code (own codeunit, in with existing codeunit, even tried Waldos generic example)
does anyone have any ideas what the problem might be?
Hi Gary,
Did you maybe by mistake create a new manifest file for your 1.0.0.2 version (= new App ID guid) ?
In that case NAV won’t see it’s the same extension application and will not restore archived data.
Thanks very much for your reply, You are correct, i was creating a new manifest in memory and creating my package from that, using the syntax below I’m able to retrieve a manifest and change the version thereby preserving the App ID. Many thanks for your assistance Jens, have a great weekend!