Have you ever tried to publish an app-file using the Publish-NavApp PowerShell Cmdlets on a on-premises Microsoft Dynamics 365 Business Central and was stopped by errors like these:
Publish-NAVApp : Extension compilation failed source/codeunits/Cod13653.PaymentExportManagement.al(4,27): error AL0185: Codeunit 'Payment Export Mgt' is missing source/codeunits/Cod13656.DataMigration.al(15,28): error AL0185: Codeunit '9002' is missing source/codeunits/Cod13650.FIKManagement.al(54,24): error AL0185: Table 'Payment Method' is missing source/codeunits/Cod13650.FIKManagement.al(98,29): error AL0185: Table 'Company Information' is missing source/codeunits/Cod13650.FIKManagement.al(126,59): error AL0185: Table 'Bank Acc. Reconciliation' is missing source/codeunits/Cod13650.FIKManagement.al(128,18): error AL0185: Table 'Bank Account' is missing source/codeunits/Cod13650.FIKManagement.al(129,22): error AL0185: Table 'Data Exch. Def' is missing source/codeunits/Cod13650.FIKManagement.al(130,26): error AL0185: Table 'Data Exch. Mapping' is missing […] source/codeunits/Cod13657.FIKSubscribers.al(360,46): error AL0132: 'Page' does not contain a definition for 'Payment Application' source/codeunits/Cod13657.FIKSubscribers.al(361,56): error AL0185: Page 'Payment Application' is missing source/codeunits/Cod13657.FIKSubscribers.al(361,111): error AL0185: Table 'Bank Acc. Reconciliation Line' is missing At line:10 char:1 Publish-NAVApp -ServerInstance $ServerInstance -SkipVerification -Pat …~~~~~~~~~~~~~~~~~ CategoryInfo : InvalidOperation: (:) [Publish-NAVApp], InvalidOperationException FullyQualifiedErrorId : MicrosoftDynamicsNavServer$DynamicsNAV/nav-systemapplication,Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp
Note – it seems that all objects are missing!?
It seems illogical, but it is fixed by running symbol generation:
- In the Microsoft Dynamics 365 Business Central administrative console you should set the parameter Enable loading application symbol references at server startup in the Development group.
- Then you should go to the Program Files (x86) installation folder for the Role Tailored Client (typically C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\<version>\RoleTailored Client) and run this command:
finsql.exe Command=generatesymbolreference, Database="<application sql database>", ServerName=<sql server host name>, ntauthentication=no, username=<sql server username>, password=<sql server password>
Note: The finsql.exe command will start a background finsql.exe process (you can see it in Windows Task Manaer). When it finishes it will write one or two text-files in the Role Tailored Client directory – one with status (filename navcommandresult.txt) and the other one if any errors happens (filename naverrorlog.txt).
These two steps fixed it for me.
You can read more about the symbol generation in the Microsoft documentation by clicking here!