I think the problem may be that you are trying to do too many steps at once.
First install Navision Client with a local database and get that to work properly.
Once that is functioning and you can get into Navision, and post docuemnts, then install the server, make sure to use TCP and then try to connect the client to the server and then the server to your earlier database. Look for the documents you posted to make sure it is accessing the correct database, and in Databse Options, make sure you are connecting via server, and not directly to the database.
Now try installing NAS using the same connection paramaters.
But don’t even look at NAS until you have basic Navision in a client server environment up and running.
It sounds like you may have a coding issue in your function99. Try taking everything out of the function but the call to YOUR functionality. How are you running your functionality, single instance codeunit that starts a timer or what?
Also you can debug your code by creating a codeunit that runs the codeunit 1 function99 and running that from a Navision client with debugger on to catch the errors…