1 - DevTool Manual
1 - DevTool Manual
TM
Microsoft, MS-DOS, Windows, Windows Server, Windows Vista, Application Server for
Microsoft Dynamics NAV, AssistButton, C/AL, C/FRONT, C/SIDE, FlowField, FlowFilter,
C/SIDE Database Server for Microsoft Dynamics NAV, Microsoft Business
Solutions–Navision, Microsoft Dynamics NAV, Microsoft Dynamics NAV Debugger,
Navision, NAV ODBC, SIFT, SIFTWARE, SQL Server, SumIndex, SumIndexField are either
registered trademarks or trademarks of Microsoft Corporation in the United States
and/or other countries.
®
This book is a manual for Developer’s Toolkit for Microsoft Dynamics NAV. It describes
various aspects of using the Developer’s Toolkit in your daily work.
The manual provides an overview of what the Developer’s Toolkit contains, what it can
do and how it works. All examples you find in this manual are based on Microsoft
Dynamics NAV version W1 4.00.
Because the book just gives an overview, it does not cover every detail of the
Developer’s Toolkit. If you need to find out more about certain fields or windows that
are not described in this book, you can use the online Help, which provides guidance
for all the windows in the program.
Using the Developer’s Toolkit manual will be easier if you are familiar with the symbols
and typographical conventions used in them. The list below indicates how various
fonts, type styles and symbols are used to refer to elements of the program:
Appearance Element
Developer’s Toolkit provides you with a collection of analysis and development tools
that can help reduce the time required to examine the structure of a Microsoft
Dynamics NAV database and to update customized solutions.
Note
Before you use the Developer’s Toolkit, you should read and understand the Microsoft
Dynamics NAV Application Designer’s Guide.
In working with the Developer’s Toolkit, you have different options for looking at
Microsoft Dynamics NAV objects. You can work with object data that specifically comes
from your application database. You can also work with object data from the
demonstration database.
If you want to work with object data from your application database, you must export
all objects from the application database in text format and import this object file into
the Developer’s Toolkit database. You can also use a running Microsoft Dynamics NAV
client connection to access the Microsoft Dynamics NAV application database directly.
If you have worked with a previous version of Developer’s Toolkit, you can upgrade an
existing Developer’s Toolkit database.
You can access the Developer’s Toolkit database as a local or a server database.
Developer’s Toolkit uses C/FRONT to access the database.
10
1.1 The Concept of the Developer’s Toolkit
11
Chapter 1. Introduction to Developer’s Toolkit for Microsoft Dynamics NAV
• Relations to Tables
• Relations from Objects
• Where Used
You can see the results either in an Object Tree or an Object Diagram window. You
can continue to use the functions on these results to continue your analysis.
The Method Flow displays C/AL code lines grouped into blocks by keywords. In the
Method Flow window, you can explore these blocks by expanding them, even if these
lines contain a trigger or procedure call to another object.
Source Finder
The Source Finder is a powerful tool for searching in all object data for any specific
character string. You can include and exclude data areas where the program should
search. For example, you could specify a search only in properties or field names. You
can use either the objects from the Object Administrator or the result of another
Source Finder search as a data reference.
Documentation
Use the print and preview functions from nearly all windows to print object data, such
as C/AL code lines or the results of your analysis.
You can save all object views to store the results or to load and print them without
processing the whole analysis again.
In addition, you can export all results of your analysis in bitmap or text format, or you
can use the clipboard to copy the information into other applications for further
documentation or training purposes.
12
1.3 The Features of Compare & Merge Tools
Merge Setup
The Merge Setup allows you to set up all information necessary to compare three
reference versions and to merge them into a fourth version. Regardless of whether the
objects from the reference versions are already imported in the database or you want
to import one or more versions before you start the merge process, the Merge Setup is
your general entry point for a new merge process. A special Merge Wizard is available
to guide you through the Merge Setup.
A separate Compare & Merge Code Lines window shows the C/AL code lines for one
object for all four versions. This window offers you code line editor functions to do
manual changes in C/AL code lines.
The program compares C/AL code lines in a separate window that shows only the code
lines of one object in two versions.
13
Chapter 1. Introduction to Developer’s Toolkit for Microsoft Dynamics NAV
14
Chapter 2
1 Start the Microsoft Dynamics NAV client. If you are creating a database for SQL
Server, the client must be a Microsoft Dynamics NAV SQL client, and you must
connect to the SQL Server.
2 Create a new database by clicking the File menu, pointing to Database, and clicking
New.
If you are not working with SQL Server, then, in the New Database window, create
the database in the directory where you installed Developer’s Toolkit. If you want to
import the object data of a standard Microsoft Dynamics NAV application database
later on, you should use at least 500 MB as the file size for this new database.
If you are working with SQL Server, then, in the Select Server window, select the
SQL Server. In the New Database window, insert a new database name.
3 Open the Object Designer and import the file DevTool.fob from the directory
where you have installed Developer’s Toolkit.
4 Create a new company. You can use different companies to store object data from
different application databases in one Developer’s Toolkit database.
Copying a Database
If you have already created a Developer’s Toolkit database, you can copy the database.
If this database has one or more companies, you must delete these companies in order
to have a new and empty database. You do not need to import the file DevTool.fob
again.
16
2.2 Importing Object Data
You can either import these objects from an object file in text format or you can use a
running Microsoft Dynamics NAV client that is connected to the application database
to transfer objects directly into the Developer’s Toolkit database.
If you choose to import object data from a text file, you must first export these objects
from the Microsoft Dynamics NAV application database into an object file in text
format.
2 Connect to your application database and open the Object Designer window.
3 Click All on the left side of the Object Designer window and mark all objects.
You do not always need to export all objects of your application database. For example,
if you have changed only some objects and you want to analyze them, you can select
and export only these objects.
Note
If you want to use objects in a compare and merge process, you must export all object
versions with the same Microsoft Dynamics NAV client version (for example Microsoft
Dynamics NAV 4.00), because of changes in the Microsoft Dynamics NAV text file
format between the versions.
You must always have an import version before you can import object data in the
Developer’s Toolkit database. You can import the object data into an existing import
version, or you can create a new import version.
17
Chapter 2. Developer’s Toolkit Database
Note
Before you can create an import version in a new database, you must create a company
in the Developer’s Toolkit database. You should use at least one company per customer
database or different application languages. You can also use different databases, each
with one company.
2 On the File menu, point to Database and click Open to open a Developer’s Toolkit
database or to connect to a Developer’s Toolkit server database.
3 On the File menu, click Import. The Import Version Card window appears.
Fill in the fields as necessary, according to the guidelines below. Some fields have no
guideline because they are self-explanatory or because they are already filled in:
Field Comments
General Tab:
Description
Description 2
Date
No. of Objects The program automatically fills in this field with the
number of objects that you have already imported in this
version.
Import Tab:
Import File Name If you want to import object data from an object file,
enter the name of the object file in this field.
18
2.2 Importing Object Data
Field Comments
Import from Check this option to import the objects directly from a
Microsoft Dynamics Microsoft Dynamics NAV application database. After you
NAV Client start the import, select a running Microsoft Dynamics
NAV client instance in the Select Microsoft Dynamics
NAV Client window. After you have selected the
Microsoft Dynamics NAV client instance, a window
appears where you can set object filters. The program
automatically transfers all filtered objects from the
Microsoft Dynamics NAV application database to the
Developer's Toolkit database and stores them in the
current version.
New Version Check this option, if the import should treat these objects
as a completely new version. New version means that this
version can be selected in the Object Administrator
window and can be used in the compare and merge
process.
Base Version Code In this field, you can select an existing version of objects.
If the New Version option is checked, the program
copies all objects from the selected base version and
replaces existing objects with the objects from the import
file.
Update Option If you have already imported object data in this company,
you can use this option to select the update method.
Date This field shows the date of the last import. It is always the
system date from the computer where you start the
import.
Keywords Tab:
STX Filename You can select a Microsoft Dynamics NAV STX file that
belongs to the version of the application database from
which you have exported the object file. After you have
entered the STX Filename, the program automatically
fills in the other fields on this tab.
19
Chapter 2. Developer’s Toolkit Database
Field Comments
Yes Expression The country-specific expression for the keyword Yes in the
object file.
System Tab:
Date in Import File This field is filled in automatically when you fill the
Import File Name field. You can see the date format of
the first object in the import object file.
Date Format Enter the date format for the date field in the import file.
You can use your country-specific shortcuts for day,
month, and year, but you must make sure that the
delimiters are the same as in the field Date in Import
File field.
Time in Import File This field is filled in automatically when you fill the
Import File Name field. You can see the time format of
the first object in the import object file.
Time Format Enter the time format for the date field in the import file.
You can use your country-specific shortcuts for hour,
minute, and second, but you must make sure that the
delimiters are the same as in the field Time in Import
File.
Filter Tab:
Object Type You can enter filters in these fields to reduce the number
Object ID of objects that will be transferred during the import
Date through a Microsoft Dynamics NAV client.
Time
Version List This field are only editable if you have placed a check
Modified mark in the Import from Microsoft Dynamics NAV
Client field on the Import tab.
20
2.2 Importing Object Data
if you wish to use a new object file or one with a different path, you must create a new
import version card.
Note
If you only want to analyze the current object version of your application database, you
should use the Replace option in the Update Option field. This option ensures that
the program always deletes the old data version of an object before importing the new
object. This reduces the duration of the import and the space needed in the
Developer’s Toolkit database.
• If the company is empty, the program asks if you want to import the objects now.
Click Yes to import the objects. Click Cancel to cancel the import process. Click No to
open the Import Worksheet window (described below).
• If the company already contains objects, the program asks if you want to continue
the import by opening the import worksheet, or whether you want to cancel the
import. You can open the Import Worksheet window by clicking OK, or you can
cancel the import by clicking Cancel.
• If there are conflicts, the program tells you this, and you can choose either to cancel
the import or to go to the Import Worksheet window by clicking OK from the
dialog.
There are two kinds of conflicts that can occur between the versions: The first may
occur if the object name, date, time, or version list of the new and the existing objects
are not the same, indicating that the new version contains changes. Another type of
conflict arises if you have canceled a processing import and restarted this import again.
When the program finds a conflict, you see a warning icon in the Warning field and
the Action field is set to Skip.
When you first click the Import button in the import version card, the following status
window appears:
21
Chapter 2. Developer’s Toolkit Database
When the program has scanned the object file and you have opened the import
worksheet, the Import Worksheet window appears:
Each line in the import worksheet displays information about one object and lets you
decide how to handle the object by setting an option in the Action field.
During the object import, the program displays the following status window:
Note
If an import error occurs, the program stops and displays an error message indicating
in which object the error has occurred. Using the error message, you can check the
areas that have not been imported to find the corresponding line in the object file to
correct the error. All objects that are already imported when the error occurs remain in
the database.
22
2.2 Importing Object Data
After the object import has finished, the information about the relations between
objects is updated. During this process, the program displays the following status
window:
After the update has finished, the objects in the Object Administrator window are
updated and the following window appears:
Attention
The import process uses much of the processor resources. Other applications might
work more slowly during the import.
23
Chapter 2. Developer’s Toolkit Database
If you want to set up the Developer’s Toolkit demonstration database, use the
following procedure:
1 Start the Microsoft Dynamics NAV client. If you are using SQL Server, then be sure
the client is a Microsoft Dynamics NAV SQL client and connect to the SQL Server.
2 Create a new database by clicking the File menu, pointing to Database, and clicking
New.
If you are not working with SQL Server, then, in the New Database window, create
the database in the directory where you installed Developer’s Toolkit. If you want to
import the object data of a standard Microsoft Dynamics NAV application database
later on, you should use at least 500 MB as the file size for this new database.
If you are working with SQL Server, then, in the Select Server window, select the
SQL Server. In the New Database window, insert a new database name.
3 Restore the Microsoft Dynamics NAV backup file DevTool.fbk into this database
from the directory where you installed Developer’s Toolkit.
5 Start Developer’s Toolkit. Point to Database on the File menu and click Open to
open the previously created Developer’s Toolkit database.
The demonstration database includes one company with an import of all objects from
Microsoft Dynamics NAV application database version W1 4.00.
24
2.4 Upgrading or Converting an Existing Database
Since, starting with version 2.0, you can now use SQL Server-based databases, it is also
possible to convert your existing Developer’s Toolkit database to a database that runs
on SQL Server.
1 Start the Microsoft Dynamics NAV client, and open the Developer’s Toolkit database.
3 Click the File menu, click Import. In the dialog box that opens, browse to the
DevTool.fob file in the directory where you installed the newest version of
Developer’s Toolkit. Select the file and click Open.
4 Click Report in the Object Designer. Select report 99003600 Upgrade to Version
2.00, click RUN (ALT+R) and follow the instructions. The upgrade process may take a
while, depending on your database size. You must run this report for each company.
The database is now ready to be used with the latest version of Developer’s Toolkit.
Before you begin the process to convert the database, we recommend that you delete
all users. You can create the users again in the SQL Server database when you are
finished.
1 Start the Microsoft Dynamics NAV client and open the existing Developer’s Toolkit
database.
3 Click the File menu and click Import. In the dialog box that opens, browse to the
DevTool.fob file in the directory where you installed the newest version of
Developer’s Toolkit. Select the file and click Open. Your database now has the
newest Developer’s Toolkit objects.
4 Click Report in the Object Designer. Select report 99003600 Upgrade to Version
2.00, click RUN (ALT+R) and follow the instructions. The upgrade process may take a
while, depending on the database size. You must run this report for each company.
5 In the Tools menu, click Backup and create a backup file of all objects in your
database.
25
Chapter 2. Developer’s Toolkit Database
7 Start a Microsoft Dynamics NAV SQL client and connect to the SQL Server.
8 Create a new database by clicking the File menu and clicking Database, New.
9 In the new database, restore the backup of the objects from the old database by
clicking the Tools menu and clicking Restore.
Once you have restored the objects to the new SQL Server-based database, the
database is ready to use in Developer’s Toolkit.
26
Chapter 3
Source Analyzer
The Source Analyzer examines the object data that you have imported from the
application database into the Developer’s Toolkit database. During the object import,
all information about an object is divided into different areas in the Developer’s Toolkit
database. These areas are:
The Source Analyzer offers you different views, tools and functions for analyzing the
object data in these areas. Depending on the information you are looking for, you will
use the Object Administrator, Object Views, Object Tools or Object Functions to
examine the object data.
28
3.1 Overview of Source Analyzer
Object Administrator
The Object Administrator window displays the objects you have imported into the
Developer’s Toolkit database.
Object Functions
You can use the functions below to analyze the structure of the database and the
relations between objects:
• Relations to Tables
• Relations from Objects
• Where Used
This chapter describes the main purpose of each window and function. It also shows an
example of how to access each window and function.
Object Views
Object Views display the results of the Source Analyzer functions. There are two
different windows available:
• Object Tree
• Object Diagram
Object Tools
The Object Tools are designed to explore the object data, performing tasks like
searching for a text string, viewing C/AL code, or collecting objects. The following
Object Tools are available:
• Source Finder
• Code Viewer
• Object Bin
• Method Flow
29
Chapter 3. Source Analyzer
After you have connected to a database, the Object Administrator window appears
automatically. In the header of the Object Administrator window, you can select a
version of objects that are already imported. The Object Administrator window
always appears on the left side of the Developer’s Toolkit desktop:
1 Click the "+" sign in front of the Table object group to expand this group. Now you
can see all tables.
2 Click the "+" sign in front of the Currency table to expand the first level of this
object.
3 Click the "+" sign in front of the Fields group. You can see a list of all fields in this
table.
30
3.2 Object Administrator
5 In the View menu, click Expand All to expand all levels below this field. The result
appears in the Object Administrator window:
You can also use the shortcut menu to access some basic functionality for the currently
marked line in the Object Administrator window.
31
Chapter 3. Source Analyzer
Note
If you start one of the Object Functions, the result is displayed in an Object View. The
Object Views are described in detail later in this manual.
Relations to Tables
The Relations to Tables function shows you all table relations in the current object
pointing to other tables.
In Microsoft Dynamics NAV, table relations can be defined in the properties of table
fields and data controls, such as textboxes. This means that you can use these functions
for tables, forms, reports and dataports.
1 Click the Currency table in the Object Administrator window to mark the table.
2 On the Functions menu, click Relations to Tables, or click the Relations to Tables
command on the shortcut menu. The Object Tree window appears showing you the
objects defined as table relations in the Currency table:
32
3.3 Object Functions
3 Click the Currency table in the Object Tree window to mark this table and click
Expand All on the View menu to expand all levels.
1 Click the Finance Charge Terms table in the Object Administrator window to
mark this table.
2 On the Functions menu, click Relations from Objects or use the shortcut menu to
start the function. The Object Tree window appears showing you which objects have
table relations that point to the Finance Charge Terms table:
33
Chapter 3. Source Analyzer
3 Click the Finance Charge Terms table in the Object Tree window to mark this table
and expand all the lower levels.
Where Used
The Where Used function shows all the places where an object or a part of an object is
used. The Where Used function searches in properties and C/AL code of all object
types.
34
3.3 Object Functions
To set up the Where Used options, click the Where Used Options command on the
Tools menu. The Where Used Options window appears:
When you use the Where Used function the first time, the program uses the default
setup values. After you have changed the values in the Where Used Options window,
click OK to save these options. The next time you start the Where Used function, the
program will use the new settings. Click the Reset button and click Default to reset all
options to their default values.
Note
The program saves the changed values in the Where Used Options window when you
click OK in this window. The program also uses these settings after you restart
Developer’s Toolkit.
1 Click the Item Translation table in the Object Administrator window to mark this
table.
2 On the Functions menu, click Where Used or click the Where Used command on the
shortcut menu to start the function. The Object Tree window appears showing you
where the Item Translation table is used:
35
Chapter 3. Source Analyzer
3 Click the Item Translation table in the Object Tree window to mark this table.
Expand all levels below the table.
4 Click the Where Used Options entry in the Object Tree window to mark this entry
and click Collapse All in the View menu, or click the Collapse All command on the
shortcut menu, to collapse all levels.
36
3.3 Object Functions
The Where Used With Options window appears automatically when you start the
Where Used With function:
After you fill the options and click OK, the program runs the Where Used function.
However, the program does not save these options in the general Where Used options.
If you want to change the general Where Used options so that they apply every time
you run the Where Used function, click the Where Used Options command on the
Tools menu. These general Where Used options are used as presettings for the Where
Used With function.
Note
The changes in the Where Used With Options window do not change the general
Where Used options.
1 Click the Item Ledger Entry table in the Object Administrator window to mark
this table.
2 On the Functions menu, click Where Used With, or click the Where Used With
command on the shortcut menu, to start the function. The Where Used With
Options window appears.
37
Chapter 3. Source Analyzer
4 Click OK to start the Where Used With function. The Object Tree window appears
showing you where the Item Ledger Entry table is inserted:
5 Click the Item Ledger Entry table in the Object Tree window to mark this table.
Expand all levels.
38
3.3 Object Functions
6 Click the Where Used Options entry in the Object Tree window and collapse all
levels below.
39
Chapter 3. Source Analyzer
1 Click the Tools menu and click Options. The Options window appears:
2 Click the Show Function Results in field, click the AssistButton f, and select the
Object View you want to use.
1 Click the Finance Charge Terms table in the Object Administrator window to
mark this table.
2 Click the Relations From Objects command in the Functions menu or start the
function from the shortcut menu. The Object Tree window appears.
40
3.4 Object Views
3 Click the Finance Charge Terms table in the Object Tree window and click the
Where Used command in the Functions menu. The Object Tree window appears
with the result of both functions:
41
Chapter 3. Source Analyzer
1 On the Tools menu, click Options change the option in the Show Function Results
in field to Object Diagram. Click OK. You can also click the Treeview On/Off button
in the toolbar.
2 Click on the Sales Price table in the Object Administrator window to mark this
table.
3 On the Functions menu, click Relations to Tables. The Object Diagram window
appears:
42
3.5 Object Tools
• Object Bin
• Code Viewer
• Method Flow
• Source Finder
1 Click on the Sales Header table in the Object Administrator window to mark this
table.
2 On the Tools menu, click Object Bin to copy this object in a new Object Bin window.
The Object Bin window opens:
43
Chapter 3. Source Analyzer
4 Click the Order Confirmation report in the Object Bin window and click the "+"
sign in front of this report to expand the first level below:
When you start the Code Viewer window from an object or field trigger in the Object
Administrator window, the Code Viewer window automatically displays the
corresponding trigger.
1 Click the "+" sign in front of the Customer table entry to expand the first level of
this object.
4 On the Tools menu, click Code Viewer. The Code Viewer window appears:
44
3.5 Object Tools
You can expand the levels on the left side of the Code Viewer window and click, for
example, on the AssistEdit procedure to see the C/AL code in this procedure.
You can also start the Where Used function in the left side of the Code Viewer
window. In the right side, you can mark code lines and open the Object Bin window to
show all objects used in these code lines in an Object Bin window.
The color settings are always shown for the currently selected element. To see the
coloring of all elements, click the Color Preview button next to the Example field.
45
Chapter 3. Source Analyzer
You can also expand a code line that contains a trigger or a procedure call to the same
object or to another object. The Method Flow window shows a new node that shows
the code lines of this trigger or procedure as indented lines in the same window.
1 Click the "+" sign in front of the Customer table entry to expand the first level of
this object in the Object Administrator window.
4 On the Tools menu, click Method Flow. The Method Flow window appears:
5 Click the first line in the Method Flow window to mark this entry. Expand all lower
levels.
46
3.5 Object Tools
If you click one of the nodes with the name Codeunit, you can expand this node to see
the code lines from this codeunit.
Note
The default settings specify that comments and BEGIN/END lines are not shown in the
Method Flow window. On the Tools menu, click Options to change these settings.
1 On the View menu, click Object Administrator, or press F12 to hide the Object
Administrator window. This gives you more space on your Developer’s Toolkit
desktop.
2 Click the Tools menu and click the Source Finder command. The Source Finder
window appears.
47
Chapter 3. Source Analyzer
4 Click Find Now in the Source Finder window to start the search. The Source Finder
window shows the results of the search:
This Source Finder window shows you the occurrences of the expression Ledger in all
objects and all areas. You can expand the width of the columns to see the complete
entries.
Note
You can limit the search by changing the values on the Objects, Areas or Filters tabs.
48
Chapter 4
• Introduction
• Viewing Object Data
• Analyzing Objects
• Searching for Object Data
Chapter 4. Examples of How to Use Source Analyzer
4.1 Introduction
The examples in this chapter are based on standard Microsoft Dynamics NAV version
4.00 objects. These objects are already imported in the Developer’s Toolkit
demonstration database. Before you can do the exercises, you must start Developer’s
Toolkit and open the Developer’s Toolkit demonstration database (for example,
DevTool.fdb).
50
4.2 Viewing Object Data
This section explains how to view different types of object data. For the examples
below, we recommend that the Object Administrator window is always open.
1 Click the “+” sign in front of the Table object group in the Object Administrator
window to expand this group.
2 Use the Find command on the Edit menu to find the expression Sales & Rec.
3 Click the “+” sign in front of the Sales & Receivables Setup table to expand the first
level of this object.
4 Click the “+” sign in front of Fields. You see a list of all fields in this table.
5 Click the “+” sign in front of the field 4, Credit Warnings to expand the level below
this field. Now you can see the OptionString property, as shown in the following:
51
Chapter 4. Examples of How to Use Source Analyzer
To see all C/AL code lines of data item 5 in report 206, Invoice follow this procedure:
3 On the Tools menu, click Code Viewer to open the Code Viewer window.
4 Expand all triggers on the left side of the Code Viewer window.
5 Click the first line that contains DataItem 5. The program points automatically to the
first trigger of the data item on the right side of the Code Viewer window:
The right part of the Code Viewer window contains all triggers of the current object. In
the status bar of the Code Viewer window, you can always see the complete name of
the current trigger. You can use the clipboard to copy code lines into the Microsoft
Dynamics NAV C/AL editor.
52
4.3 Analyzing Objects
This section shows you some examples of analyzing objects in the Source Analyzer.
3 On the Functions menu, click Where Used. The Object Tree window appears
showing you where the Resource Price table is used:
4 Click Where Used in the Object Tree window and expand all lines. Now you can see
all levels in the Object Tree window.
5 Click the Where Used Options entry in the Object Tree window and collapse all
levels.
53
Chapter 4. Examples of How to Use Source Analyzer
You can see that table 201, Resource Price is used in table 207, Res. Journal Line as a
global record variable.
6 Click the line below table 207, Res. Journal Line in the Object Tree window.
9 Click on Where Used Options in the Object Tree window and collapse all levels.
You can see all places where table 201, Resource Price is used in table 207, Res.
Journal Line as a global variable called ResPrice.
54
4.3 Analyzing Objects
11On the Tools menu, click Code Viewer to see the corresponding code line in table
207, Res. Journal Line. The Code Viewer window appears:
12Double click the phrase ResFindUnitPrice in the current line to mark this
expression.
13On the Tools menu, click Object Bin to copy this object in a new Object Bin window.
The Object Bin window appears:
You can expand the different levels of this object to see all properties.
55
Chapter 4. Examples of How to Use Source Analyzer
15On the Tools menu, click Code Viewer to see the code lines in this codeunit. The
Code Viewer window appears:
You can see all code lines in codeunit 221, Resource-Find Price to analyze what
happens in this codeunit.
The example below shows how to analyze where the Description field in table 27,
Item is used in C/AL code lines and as source expression of controls:
1 On the Tools menu, click Where Used Option. The Where Used Options window
appears:
56
4.3 Analyzing Objects
2 Click the Properties tab and insert a x in the SourceExpr field, as you see it in the
Where Used Options window below:
3 Click OK.
4 Click field 3, Description in table 27, Item in the Object Administrator window.
5 On the Functions menu, click Where Used. The Object Tree window appears
showing you where the Item table is used:
The Object Tree window shows all objects where the Description field is used.
6 Click form 386, Extended Text and expand the levels below this form.
57
Chapter 4. Examples of How to Use Source Analyzer
8 On the Tools menu, click Code Viewer to view all lines in this local procedure. The
Code Viewer window appears:
The cursor is in front of the code line where the Description field is used. The value of
the Description field is transferred to the Descr variable.
9 Click the View menu and click C/AL Locals. Click the Variables tab:
58
4.3 Analyzing Objects
You can see the definition of the Descr variable in the Locals window, which you also
might have to change according to the changes of the Description field in table 27,
Item.
59
Chapter 4. Examples of How to Use Source Analyzer
4 Click the two lines that contain table 36, Sales Header and expand all lines to see
where these procedures are called.
60
4.4 Searching for Object Data
This section shows you some examples of how to use the Source Finder.
1 On the Tools menu, click Source Finder. The Source Finder window appears:
2 Click the Objects tab and insert a x in the Forms field only:
3 Click the Areas tab and insert a x in the Property Values field only:
5 Click the lookup button (p) in the Property Filter field. The Select Property
window appears:
61
Chapter 4. Examples of How to Use Source Analyzer
6 Mark both the BlankZero and DecimalPlaces properties by holding down the SHIFT
key as you click the properties.
7 Click OK.
The program copies the properties to the Property Filter field in the Source Finder
window:
8 Click the General tab and enter * in the Find What field:
9 Click the Find Now button to start the search. The Source Finder result window
appears:
62
4.4 Searching for Object Data
You can click the header of the Value column to sort the lines based on the values in
this column.
1 Click codeunit 12, Gen. Jnl.-Post Line in the Object Administrator window.
2 On the Tools menu, click Object Bin to copy this object to a new Object Bin window.
The Object Bin window appears:
4 Click codeunit 22, Item Jnl.-Post Line in the Object Administrator window and
drag and drop it into the Object Bin window.
5 Click codeunit 212, Res. Jnl.-Post Line in the Object Administrator window and
drag and drop it into the Object Bin window.
63
Chapter 4. Examples of How to Use Source Analyzer
6 Click codeunit 80, Sales-Post in the Object Administrator window and drag and
drop it into the Object Bin window.
7 Click codeunit 90, Purch.-Post in the Object Administrator window and drag and
drop it into the Object Bin window.
8 On the Tools menu, click Source Finder. The Source Finder window appears:
9 Click the dropdown button (f) in the Reference View field and select Object Bin -
1:
10Click the Areas tab and insert a check mark (x) in the C/AL Code field only:
11Click the General tab and enter // in the Find What field:
64
4.4 Searching for Object Data
12Click the Find Now button to start the search. The Source Finder result window
appears:
14On the Tools menu, click Code Viewer to see the code lines in this local procedure.
The Code Viewer window appears:
65
Chapter 4. Examples of How to Use Source Analyzer
If you go back to the Source Finder window and open the Code Viewer window
based on another line again, the existing Code Viewer window will be updated.
66
Chapter 5
The basic idea behind Developer’s Toolkit is to have one database with all information
about objects to be used during an upgrade and one program that provides the user
with all functions needed during an upgrade process.
The picture below shows the structure and the elements of Developer’s Toolkit -
Compare & Merge:
Reference Versions
Each version used in the compare and merge process is called a reference version.
Basically, the Compare & Merge Tool compares three different versions of an object in
order to create a new version:
70
5.1 Overview of Compare & Merge Tool
Process Overview
The picture below shows how the program uses the reference versions and the basic
steps of an upgrade process:
The update process can be split up into the steps described in the following sections.
71
Chapter 5. Compare & Merge Tool
Automatic Merge
Based on the defined reference versions, the user starts the automatic merge process.
The program creates a new version as a merge result. The program marks any objects
that could not be merged automatically. The user must then merge these objects
manually.
The program uses colors to show where the differences and conflicts are between the
compared versions, if there are conflicts.
Export Objects
All objects from the new version must be exported from the Developer’s Toolkit
database in either a text format or directly to the Microsoft Dynamics NAV application
database.
72
5.2 Merge Setup
For each reference version (Current Custom, Old Base, New Base Versions) you can
either select an already imported version, or you can enter an Import File Name that
contains Microsoft Dynamics NAV objects in text format. If you do not have a version
already imported you must also enter a code in the Version field. You must also enter
a code in the field New Custom Version.
Depending on the merge scenario, you can set different options to speed up the
compare and merge process. The following sections contain the setup for three
different scenarios.
73
Chapter 5. Compare & Merge Tool
Focus on Objects in, you must select Current Custom Version. With this setting, the
program only compares and merges objects that exist in the Current Custom Version.
As a merge result, you receive all objects from the Current Custom Version merged
with the same objects from the New Base Version. This is a fast way to do the merge
process, if only your Current Custom Version contains changed objects.
If you do not check the field Import all Objects, the program only imports objects
from reference version files that exist in the Current Custom Version.
Please refer to the online Help if you need more information about the fields in the
Merge Setup window.
Note
All versions of objects that you want to use in one compare and merge process must be
exported with the same Microsoft Dynamics NAV client version (for example, Microsoft
Dynamics NAV 4.00), because of changes in the Microsoft Dynamics NAV text file
format between versions.
Merge Wizard
You can use the Merge Wizard windows to enter the merge setup information. The
Merge Wizard guides you through the setup procedure. In the first window of the
wizard you select the current custom version:
All information that you enter in the Merge Wizard is saved in the merge setup. The
fields are exactly the same as in the Merge Setup window.
74
5.2 Merge Setup
The program first imports the versions, if required, and then starts the compare and
merge process. After this process is finished, the program shows a summary of the
process. After you confirm this summary, the result of the automatic merge is shown in
the Compare & Merge window.
75
Chapter 5. Compare & Merge Tool
During the import, for each object, the program creates a computed value called a
checksum. The checksum includes all object data, except the fields Date, Time,
Version List and Modified. In the first step, the checksum is compared for each
object. Based on this checksum, the program decides whether an object can be easily
copied to the New Custom Version or if a merge on the detail level is required, if the
object is different in all three reference versions.
During the detail-level merge, the program first compares Current Custom Version and
Old Base Version. After that, it compares the New Base Version and Old Base Version.
The result of this comparison leads to an action to create the New Custom Version. If
there is a conflict because a detail has been changed in the Current Custom Version
and the New Base Version, the program copies the information from the version that is
defined in the Merge Options.
If you want to know more about the merge rules, please read the online Help.
After the program has finished the automatic merge process, the status window
displays the number of objects that have been copied and merged and how many
objects have conflicts and overlapping controls. After you close this status window, the
Compare & Merge window appears.
The manual merge process is always required when the automatic merge is not
possible due to conflicts between the reference versions. You must decide manually
which object version you want to use as a new version. The manual merge could be
necessary for the whole object or only for one or more areas in an object. You can do
this in the Compare & Merge window.
76
5.3 Compare & Merge
All columns are synchronized vertically and horizontally. You can expand objects to see
the details and collapse objects to reduce the object details shown in the Compare &
Merge window.
This window is an example and contains only a small sample of objects in each version.
The coloring is used to show the differences between the reference versions. A conflict
bitmap indicates that the program could not merge automatically. You should always
check the suggestion in the New Custom Version and either mark this suggestion as
accepted or change it.
You can change the details of an object in the New Custom Version only. If you want to
undo your changes in an object, you can click Remerge in the shortcut menu on the
object level. This remerge will overwrite all your changes in this object.
If you want to see the C/AL code for an object, open the Compare & Merge Code
Lines window.
77
Chapter 5. Compare & Merge Tool
The Compare & Merge Code Lines window shows all C/AL code lines for an object in
each version that is used in the current compare and merge process. You can open the
Compare & Merge Code Lines window from a selected object or a specific trigger.
The coloring indicates the status of each code line. The conflict bitmap is shown in
front of the corresponding line in the New Custom Version:
You can change all lines of an object in the New Custom Version only. If you start
remerging for an object, the program also remerges the code lines and your changes
will be overwritten.
When you click the Tools menu and click C/AL Globals, the Compare & Merge C/AL
Globals window appears. This window shows the global variables for the current
object and is not editable. Click the Tools menu and click C/AL Locals to open the
78
5.3 Compare & Merge
Compare & Merge C/AL Locals window. This window shows the local variables for
the current trigger or function and is also not editable.
Note
The code line editor does not perform any syntax check in code lines. Syntax errors in
code lines might cause problems during import or compilation in the application
database.
During the manual merge process, the program saves all changes as soon as you click
on another object or when you close the Compare & Merge window. You can close
the program and continue whenever you want.
Note
It is only possible to have one merge project per Microsoft Dynamics NAV company. If
you want to process more than one merge process in parallel, you must create a new
company in the same database or in a new database.
Note
Only forms and request forms in reports are checked for overlapping controls.
79
Chapter 5. Compare & Merge Tool
Each column displays all objects of the versions you have selected in each column
header. When you select a version, the program starts the comparison automatically.
Both columns are synchronized vertically and horizontally and coloring is used to show
the differences on all levels. When an item in a tree is not expanded, the item
represents the coloring of details of the item. If you want to set a filter on object type
or object ID, click on the Functions button in this window.
80
5.4 Compare Two Versions
The coloring indicates the status of each code line. You can use the icons on the menu
bar to jump to the previous or next difference.
Attention
The printout of this report and a jump to the last page in the preview may take some
time, because both versions have to be compared again before the printing. You can
reduce the time by printing differences only.
Attention
This export may take some time, because both versions have to be compared again
before the export. You can reduce the time by exporting differences only.
81
Chapter 5. Compare & Merge Tool
Export Worksheet
You can use the Export Worksheet to export objects from Developer’s Toolkit either
directly to a Microsoft Dynamics NAV application database or to a file in Microsoft
Dynamics NAV text format. On the File menu, point to Export, and click Microsoft
Dynamics NAV Text File or Client to open this window. The Export Worksheet
appears:
After you have selected the object version in the header of the Export Worksheet, the
window shows all of the objects from this version. You can filter objects by setting field
filters or by marking lines. Click the Export button and click To Microsoft Dynamics
NAV Text File... to export all marked objects as a Microsoft Dynamics NAV text file, or
click To Microsoft Dynamics NAV Client... to export all marked objects directly to a
Microsoft Dynamics NAV database.
If you have chosen to export to a Microsoft Dynamics NAV text file, a request form
appears in which you can select whether or not to print one file per object and specify
the file name for the text file. Click OK to confirm your selection, and all the marked
objects are exported to a Microsoft Dynamics NAV text file.
If you have chosen to export to a Microsoft Dynamics NAV client, the Select Microsoft
Dynamics NAV Client window opens, from which you can select the appropriate
Microsoft Dynamics NAV client. Click OK to confirm, and all marked objects are
exported to the Microsoft Dynamics NAV database.
82
Chapter 6
Attention
Before you begin installing the program from the program CD, make a copy of it. Then
use the copy to install the program and save the original as a backup.
If you are installing the Developer’s Toolkit from a network drive or a CD-ROM, make
sure that you are connected to the network server or CD-ROM drive.
2 Click the Start Button on the task bar and then click Run.
3 Type the path and name of the installation program. If you are installing from CD,
for example, the path is d:\setup, where d: is the drive of your CD-ROM. If you
install from a network drive, type the path and name of the installation program on
the network. Click OK to start the installation program.
Under Windows 98/2000/XP, Windows NT version 4.0 or later, or Vista, you can also
use the Add/Remove Programs function in the Control Panel.
After you have started the installation program, the Welcome window appears.
4 To continue, click the Next button at the bottom of the window. If you decide not to
continue with the installation, click Cancel. If you continue, the Disclaimer window
appears.
5 Click Yes in the Disclaimer window to accept this disclaimer. The setup continues.
Click No, if you do not accept this disclaimer. The setup closes.
6 If you accepted the disclaimer, the Latest Release Information window appears. In
this window, you see the latest information for the current release. Click Cancel to
cancel the installation program or click Next to continue.
84
6.1 Installing and Uninstalling
7 The Choose Destination Location window appears next. Here, you must specify
the folder where Developer’s Toolkit should be installed. You can accept the default
(in this case, c:\Program Files\Microsoft Dynamics NAV\Developers Toolkit) or you
can click Browse to select a different location.
8 Click Next in the Choose Destination Location window. The Select Copy Options
window appears.
In this window, you can decide if you want to select a Microsoft Dynamics NAV
license file (for example fin.flf) and a Microsoft Dynamics NAV STX file (for
example fin.stx). Both files are copied to the directory where you are installing the
program. The STX file is used as default for keywords that are used during the
import. You can change these keywords later. If you do not select an STX file, the
program uses the default STX file from the setup program.
9 Click Next.
If you have checked one of the file options, the Select File window appears. After
you have selected all files the Start Copying Files window appears.
If you did not check a file type option, the Start Copying Files window appears
right away. This windows shows a summary of all information that has been
collected during the previous steps.
10Click Next to start the actual installation.You can follow the progress of the
installation in the Setup Status window.
11As soon as the installation program has finished, a message appears. Click Finish. The
window closes.
85
Chapter 6. Installing and Starting Developer’s Toolkit
Start Developer’s Toolkit to gain access to all the analyzing and development tools. In
order to work with a database, you must open a local database or connect to a server
database.
Note
When you use Developer’s Toolkit the first time, you must set up a database. Please
refer to chapter 2, "Developer’s Toolkit Database" or read the online Help to get more
information about the setup of a Developer’s Toolkit database.
1 Click the File menu, point to Database, and click Open. The Open Database window
appears.
2 In the Path to C/FRONT field, enter the location of the cfront.dll file or the
cfrontsql.dll file, depending on the server type you are using. The default value
in this field points to the installation directory. You can click the AssistButton to open
a dialog window from which you can browse and select the file.
3 If you want to connect to a server database, select the server name and the net type.
Make sure that the server has already been started.
4 Enter the database name and specify whether you want to use the Windows
authentication or the database server authentication when opening the database. If
you select database server authentication, enter the user ID and password as well.
86
INDEX
C Export Objects 82
Code Viewer window 44 Export Worksheet 82
Color Options exporting application objects 17
setting up 45 F
Compare & Merge 76 Functions 32
Automatic Merge Process 76 I
Code Lines 78 Import Version Card 18
Compare & Merge Window 77 Import Worksheet 22
interrupting a Merge Process 79 installing the program 84
Manual Merge Process 76 M
Merge Setup 73 Merge Setup 73
Merge Wizard 74 Merge Wizard 74
Overview 70 Method Flow window 45
Start Process 75 N
Compare Two Versions 80 New Base Version 71
Code Lines 80 New Custom Version 71
Export 81 O
Print Report 81 Object Administrator window 30
converting a database 25 Object Bin window 43
copying a database 16 object data
creating a new database 16 importing application objects 17
creating an import version 17 Object Diagram window 42
Current Custom Version 71 object export 82
D object file
database exporting application objects 17
connecting to a server 86 Object Functions 32
copying 16 object import
creating a new 16 creating an import version 17
opening a local 86 importing object data 17
demonstration database starting 21
setting up 24 using an import version 20
E Object Tools 43
example Object Tree window 40
analyzing usage of a table 53 Object View
finding usage of a field 56 setting up the default 40
finding usage of a procedure 59 Object Views 40
searching for comments 63 Old Base Version 71
searching for properties 61 Overlapping Controls
viewing C/AL code lines 51 Print Report 79
viewing object properties 51 R
Reference Versions 70
Relations from Objects 33
Relations to Tables 32
S
Source Analyzer
Features 12
overview 28
Index