Skip to main content

Debugging in NAV 2009,2009SP1 & NAV2009R2 RTC Client

Hi all,

With the new client version of Navision the debugging process have also been changed.

This post contain details of NAV 2009, NAV 2009 SP1 and NAV 2009 R2 RTC Client.

First step is to Stop the Microsoft Dynamics NAV Server Service.

Then we  need to don EnableDebugging in CustomSettings.config found here: C:\Program Files\Microsoft Dynamics NAV\60\Service.

Now start the Microsoft Dynamics NAV Server Service.
Now we have debugging enabled. Now start the RoleTailored client. This will take a bit longer to start up, because C# files are generated for each of the objects. (Pages, Codeunits, Reports etc.) - .cs files will be created.
In this example I will make a codeunit with a simple message and add this to an action on the Customer list.
Create a Codeunit. Ex. 50000
OnRun trigger place the following code: MESSAGE ('Debug test')

Save and compile Codeunit 50000.
Now let us add this codeunit to a action. Design page 22 and navigate to the Actions on page 22.


Insert a new action below the the Customer Action group


Hit F9 and enter this code on the Debug test -  OnAction trigger: CODEUNIT.RUN(50000);
Save and compile page 22


we now have all code completed so now let us set a breakpoint in Visual Studio.
Navigate to “C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit” IN WINDOWS 7
Assuming that you have Visual Studio installed, (In my case I’m using Visual Studio 2008 with SP1) open Codeunit50000.cs
If you have UAC turned you will need to open Visual Studio with “Run as administrator”.
Now we need to attach the NAV service. Select “Debug / Attach to process…”
Attach Microsoft.Dynamics.Nav.Server.exe
Your screen should now look like this:
Now add a break point on the message “Debug test”
With this done now let us go to RoleTailored client.
Navigate to Customer List and see that you have a new action called “Debug test” under “Related Information”
Now select “Debug test”
Visual Studio will come back in focus with the breakpoint selected.


Now try to hit F5 and debugging will continue and RoleTailored client will come back in focus and show the message “Debug test”:
"In Next post i will discuss the Debugging Process in NAV 2013 which is an enhanced version of Debugging. i Personally feel that its a better version than debugger in classic client and RTC Client till NAV 2009 R2."
Regards,
Saurav  Dhyani



Comments

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.