Install-NAVApp not working for some tables
Dear All,
I am facing strange issue on Dynamics NAV 2018 CU 8 related to Install-NAVApp. When trying to install app from PowerShell I have following error (Xxxxxx is just a name for customer in this case).
Steps to reproduce:
- Using Visual Studio Code run function AL:Package
- Run from PowerShell:
Publish-NAVApp -ServerInstance DynamicsNAV110_SE_B23572_Xxxxxx -Path 'G:\AL_Repositories\Xxxxxx_1.0.0.0.app' -SkipVerificatio -PassThru
Install-NAVApp -ServerInstance DynamicsNAV110_SE_B23572_Xxxxxx -Name Xxxxxx -Force
Issue was replicated on this server for 3 tables so far: Country/Region, Item Ledger Entry, Intrastat Jnl. Line. There were no problems for around 20 other Table Extensions.
When I build the App directly from the Visual Studio Code I can skip this error and all is correctly installed. Second run for PowerShell (if first was done via Visual Studio Code) also is correct.
If more information is needed please let me know.
Error: Install-NAVApp : The following SQL error was unexpected: Invalid object name 'Xxxxxx NAV (11-0) SE Build 23572 BASE.dbo.CRONUS AB$Item Ledger Entry$1adf36e4-5a9f-4860-9f17-c939002c2485'. At C:\Users\xxamr\Desktop\Untitled1.ps1:6 char:1
- Install-NAVApp -ServerInstance DynamicsNAV110_SE_B23572_Xxxxxx -Name Xxxxxx -For ...
-
+ CategoryInfo : NotSpecified: (0:Int32) [Install-NAVApp], FaultException`1 + FullyQualifiedErrorId : MicrosoftDynamicsNavServer$DynamicsNAV110_SE_B23572_Xxxxxx/default,Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.Instal lNavApp
Does this repro on the latest docker image? If not then unfortunately we do not deal with Nav 2018 related issues here. For that you have to ask your regular support channel. https://github.com/Microsoft/AL/wiki/Frequently-Asked-Questions
I see that you haven't posted a 'Sync-NavApp' step in your use of powershell. This is the command that actually performs the steps to modify SQL to include the schematic components of your extension (Tables, Table Extensions, etc). The correct 'path' for getting an extension onto a tenant via cmdlets is the following
- Publish-NavApp
- Sync-NavApp
- Install-NavApp
VSCode will automatically perform all of these step for you, which is probably why things work when you go that route.
My guess is that you had an older version of the extension on this tenant, have modified the extension to include new schematic items, but have not bumped the version number in your app.json.
Without doing so, the service would treat your 'new' package as if it were the 'old' one and let you just install it. This would lead to runtime errors when your code tries to access new tables that do not yet exist. (E.g. SQL errors about invalid objects)
Additionally, look at issue #1595 if/when you run into the question of 'how come I can't sync' as you make schema changes.
Hi @HunterFeltman-MSFT,
Than you for the input. I will try to add this to the script and see how it will go. Unfortunately this issue was not with all tables and it was very random. Hopefully it will help.
Best regards, Krzysztof