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
But when I have uninstalled that addons and again install that addons in my local machine I was not able to get my Archive data.
Please suggest me what should I need to do in order to fix that, I have followed below link but still not able to restore archive data.
Have you checked in SQL that the data is actually there?
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. 220.127.116.11 - 18.104.22.168) 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?
Did you maybe by mistake create a new manifest file for your 22.214.171.124 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!
Get-NAVAppManifest -Path '.\Manifest-Proseware SmartStuff.xml' | Set-NavAppManifest -Version 126.96.36.1990 -CompatibilityId 188.8.131.52 | New-NavAppManifestFile -Path ".\Manifest-Proseware SmartStuff.xml" -Force