Question

Is it possible to view the contents of a Dynamics NAV 2013 Database Table while being in a debugging session?

When I go the development environment I can normally hit run on any table and explore its contents. How ever, while the debugger is running, this is not possible, since the whole Dynamics Nav environment is frozen when the debugger stops on a break point.

One work around I have found, is to copy the relevant data to excel before running the debugger, but that is not so convenient. Also, in the watch list of the debugger, I can only view single variables, but not the whole database table.

Was it helpful?

Solution

You can simply open Sql Server Managemant Studio and have a look at the tables. Of course, you will see the changes only when they are commited. so either the code in NAV has passed the actual trigger where the record is modified or you explicit call COMMIT();

If you never used sql server management you will notice that the tables are stored with the company nam e ahead.

For example the item ledger entry in demo database is:

[CRONUS AG$Item Ledger Entry]

and a select statement for reading all records in the table could be

SELECT * FROM [Demo Database NAV (7-0)].[dbo].[CRONUS AG$Item Ledger Entry]

Regards

Alex

OTHER TIPS

The debugger does not have a "table view". You're either stuck with using SQL, without getting calculated fields shown, or you can use another session (in some cases that requires another service tier, since the debugger has the nasty tendency to block the entire service tier). But another session will not display uncommitted data.

An alternative (not great), is to create a simple method, that loops through all records and dumping FORMAT(rec) into a txt file. That method can be called in the places where you need to inspect the table.

But, unless calculated fields are necessary I would also go with SQL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top