Navision / Business Central Development Enviroment connects to wrong instance
Problem
Have you ever come across a situation where the development environment just won't connect to the right 2-tier server? So, for example, a development environment that is connected to a test database absolutely wants to open the real environment during RUN or debug, or vice versa?
And it doesn't matter whether you have entered the correct instance in Extras/Options. Selecting the correct instance via Date/Database information/Instance does not work either, as the desired instance is simply not displayed.
Reason
How does the test environment even know which Navision/Business Central services are available for a particular database? Ingeniously simple: The Business Central 365 or Navision services tell it! And exactly in this direction.
Each Microsoft Dynamics NAV Server Instance writes itself to the database as an available instance at startup (!)! The target is the table 2000000112 Server Instance.

When selecting the instance (e.g. via Database/Information, or after a RUN), the entries in this table are simply displayed.

solution
The following almost certainly happened beforehand:
A productive and operational database working with active NAV servers was backed up. The content of the 2000000112 Server Instance table was of course also backed up.
And: This backup was restored to a new database in which there is still at least one active Navision server service Active, but not connected to a client was. The server service is triggered by Navision / Business Central Clients. If there is nothing to do at the moment, it doesn't notice anything.
If the Microsoft Dynamics NAV Development Environment now connects to the database on the SQL server, the server service will not notice this either.
The result: The Navision or Business Central 365 development environment happily reads the server services active during the backup from the 2000000112 Server Instance table and displays them. Only these are visible to the development environment, not the real services!
The solution is correspondingly simple (once you have calmed down from your gasping for breath): Stop the server service for the stubborn test environment once and restart it. The NAV service then cleans up the 2000000112 Server Instance table. And then you can find the right server instance(s) for your beloved Navision /or Business Central 365 in the development environment again.
