Category Archives: Business Central General

BC18 – Business Central 2021 Release Wave 1 has been released

You can download the OnPrem version here (BC18): https://www.microsoft.com/en-us/download/details.aspx?id=102915

For an extensive list of what’s new please check Microsoft Docs:

https://docs.microsoft.com/en-us/dynamics365-release-plan/2021wave1/smb/dynamics365-business-central/planned-features

The user cannot be deleted because the user has been logged on to the system. To deactivate a user, set the user’s state to Disabled.

When you try to delete a user from BC you could encounter the following error:

The user “ADMIN” cannot be deleted because the user has been logged on to the system. To deactivate a user, set the user’s state to Disabled.

This message is somewhat confusing because this user is currently not logged in. To resolve the issue go to the User Personalization List (9173, List) and delete the mentioned user. Now you should be able to delete the useraccount.

VS Code error: Can’t push refs to remote. Try running ‘Pull’ first to integrate your changes

This error message I encountered recently a few times when I performed a Git Sync from VS Code to check the AL code to SCM (Github):

One of the causes for this error message is when you try to upload files which are greater then the allowed limit (max filesize). Check the Git Log why the problem occurred. Cause could be a file that’s too large.

Another cause could be there are no files yet that were staged. To fix this add a file to your project, stage it and then sync it to your repository.

BC14 – Generate Symbols and Build Object Search Index

The ‘Build Object Search Index’ feature in the BC14 Development Environment makes objects searchable in the webclient according to the Microsoft documentation: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-pages-report-for-search

However in another Microsoft article:

Running C/SIDE and AL Side-by-Side https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-running-cside-and-al-side-by-side

you should run a command in order to generate symbols. But actually the Build Object Search Index performs the same action. In my opinion it’s just easier sometimes to generate symbols by using the ‘Build Object Search Index’ instead of opening a Console and running the command as mentioned AND with the disadvantage of no progress in the Console which you do have in the Development Environment:

Export-NAVApplicationObject : $NavIde was not correctly set. Please assign the path to finsql.exe to $NavIde ($NavIde = path).

One step of convertering C/AL to AL is to import the fob in BC14 and then export it to text with the new syntax. This exporting can be achieved by using the Export-NAVApplicatieObject cmdlet. However I got an error I recognized but I didn’t know how to resolve it anymore. So I started Googling but couldn’t find the right answers quickly. That’s why I think this post could help also someone else or at least myself when I encounter this ‘issue’ ever again.

When executing the cmdlet you will get this error:

The term ‘Export-NAVApplicationObject’ is not recognized as the name of a cmdlet, function, script file, or operable program.

In order to fix this we need to load the module which contains this cmdlet. I loaded the module using the Import-Module cmdlet:

Import-Module 'C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\140\RoleTailored Client\NavModelTools.ps1'

this results in an error however:

Export-NAVApplicationObject : $NavIde was not correctly set. Please assign the path to finsql.exe to $NavIde ($NavIde = path).
At line:1 char:1Export-NAVApplicationObject

CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException

FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Export-NAVApplicationObject

The cause is the loading of the incorrect module. Perform the following steps to resolve the issue:

  • Close your PS (Powershell) environment
  • Run the following Cmdlet:
  • Import-Module 'C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1'

Now the Export-NAVApplicationObject works without problems!

BC140 Server Instance doesn’t start: Object reference not set to an instance of an object.

BC140 Server Instance doesn’t start: Object reference not set to an instance of an object.

Server instance: BC140
Tenant ID:
User:
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace:
at Microsoft.Dynamics.Nav.Runtime.Heartbeat.WriteHeartbeatToServiceInstanceTable()
at Microsoft.Dynamics.Nav.Runtime.PeriodicScheduler.RunAction()
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2147467261
StackTrace:
at Microsoft.Dynamics.Nav.Runtime.Heartbeat.WriteHeartbeatToServiceInstanceTable()
at Microsoft.Dynamics.Nav.Runtime.PeriodicScheduler.RunAction()

Cause: the server instance is connecting to an NAv 2017 database which isn’t correct.
Resolution: configure the server instance to connect to a BC14 database.

DotNet ‘XmlDocumentFragment’ is missing

If you still use dotnet for legacy reasons for example in Business Central. You could encounter this issue in VS Code when building your app:

DotNet ‘XmlDocumentFragment’ is missing

This class is part of the System.Xml namespace and represents a lightweight object for tree insert operation. See all the info on Microsoft Docs: https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmldocument.createdocumentfragment?view=netframework-4.8

In order to fix this in AL you need to do the following steps:

  • Setup and configure Assembly Probing Paths in VS Code Workspace Settings
  • Create a dotnet.al file in your AL Project. This file should now hold the following Json structure and contents:
dotnet
{
    assembly("System.Xml")
    {
        Version = '4.0.0.0';
        Culture = 'neutral';
        PublicKeyToken = 'b77a5c561934e089';

        type("System.Xml.XmlDocumentFragment"; "XmlDocumentFragment")
        {
        }
    }
}

DotNet ‘HttpUtility’ is missing (AL0185)

If you still use dotnet for legacy reasons for example in Business Central. You could encounter this issue in VS Code when building your app:

DotNet ‘HttpUtility’ is missing

This class is part of the System.Web namespace and is used to encoding or decode URL’s. In order to fix this in AL you need to do the following steps:

  • Setup and configure Assembly Probing Paths in VS Code Workspace Settings
  • Create a dotnet.al file in your AL Project. This file should now hold the following Json structure and contents:
dotnet
 {
     assembly("System.Web")
     {
         Version = '4.0.0.0';
         Culture = 'neutral';
         PublicKeyToken = 'b03f5f7f11d50a3a';
         type("System.Web.HttpUtility"; "HttpUtility")
         { } 
     } 
 }

It took me some time to sort this out and by sharing this post this will save you some time if you encounter an issue similar.