The other day a partner asked me about how to start the Microsoft Dynamics NAV 2013 C/AL Debugger for another NAV Server instance than the one used by C/SIDE.
The explanation is below, but first, let’s see how C/SIDE finds the NAV Server instance used for running and debugging.
The Microsoft Dynamics NAV Server Instance used by C/SIDE for Run and Debug
When you Run an application object from the C/SIDE Object designer, C/SIDE is starting a Dynamics NAV Windows client with the application url constructed from:
Read more here: Starting the Windows Client at the Command Prompt, the URL parameter.
This could be an example:
Microsoft.Dynamics.Nav.Client.exe "DynamicsNAV://localhost:7046/dynamicsnav70/CRONUS International Ltd./RunPage?Page=42"
The rest of the client configurations are taken from the default ClientUserSettings.config, which is typically found at %APPDATA%\Microsoft\Microsoft Dynamics NAV\70.
The same principle is used when you start the debugger from within C/SIDE Tools/Debugger/Debug Session.
All this works quite well in more confined setups where you can address different databases and NAV Servers if you are using the same authentication type for them all, but if you want to address different NAV Servers having for example different authentication types, you have to find other solutions – feel free to be inspired by how to.
Define Alternative Ways of Starting the Microsoft Dynamics NAV 2013 C/AL Debugger
Now let’s say you have made a dedicated NAV Test environment with:
… and you want to debug some issue that appears in the Test environment from your development environment machine.
The trick is to create a Dynamics NAV Windows client shortcuts on your development machine that specifies:
Ending up in a combined command line description:
Microsoft.Dynamics.Nav.Client.exe -settings:file "DynamicsNAV://< Server>[:<port]>/<ServerInstance>/<Company>/debug"
Or the short-form (all defaults to the .config settings):
Microsoft.Dynamics.Nav.Client.exe -settings:file "DynamicsNAV://///debug"
Adding up to shortcut examples like this:
Microsoft.Dynamics.Nav.Client.exe -settings:"%USERPROFILE%\Desktop\TestEnv.config" "DynamicsNAV://///debug"
Microsoft.Dynamics.Nav.Client.exe -settings:"%USERPROFILE%\Desktop\ProdEnv.config" "DynamicsNAV://///debug"
Or with full paths like this:
"%ProgramFiles(x86)%\Microsoft Dynamics NAV\70\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe" -settings:"%USERPROFILE%\Desktop\TestEnv.config" "DynamicsNAV://///debug"
The Windows client specifically understands the “special” /debug url, which is currently a “shorthand” for starting the client with:
The debugger can be started this way because it is working similar to any Microsoft Dynamics NAV solution.