7 min read

“The best investment is in the tools of one’s own trade.” Benjamin Franklin

Understanding the tools

Have you ever held a chainsaw in your hands? Go try it, hear it roar. Quite a beast, eh? Now, what can you do with it? Was felling timber the first image that popped up?

We had something else in mind. Have you ever seen any of those ice sculptures? Did you know that sculptors often use chainsaws to carve them out? Carving them slowly over days with fine tools is often not an option—the ice can start melting in a matter of minutes. To be able to finish in time before physics takes over, power tools must be used, and specially equipped chainsaws have been selected as a tool of choice of many ice carvers.

Modifying a big system, one like Microsoft Dynamics NAV 2009, requires a lot of skill, knowledge, and experience. While skill and experience can’t be learned from a book, knowledge for the better part of it can. There are two kinds of knowledge: the knowledge of the tools, and the knowledge of the product.

If you only know the tools, and don’t know the object you will work on with these tools, you can easily mess up. If you only know the product, but don’t know the tools, you are missing many opportunities. When you know the tools, and what they can do, and how the product will behave when it has been touched, you are on the right path.

If you are an application consultant, and you know the product and how it works, but haven’t ever dared to open it up in Object Designer and shape it to your liking, this chapter is for you. You already have the knowledge of the product, what it is and how it works; you only need the knowledge of the tools to become a true artist.

A chainsaw artist, if you wish. The tools you are about to master are quite powerful: they can craft beautifully architectured state-of-the-art solutions, or they can leave a complete mess.

Let’s become artists.

Modifications for non-programmers

In Microsoft Dynamics NAV 2009, it is possible to create a fully functioning modification without really writing a single line of code. As a matter of fact, it happens quite often. Often, customers will demand changes that are simple in nature: adding a field to a report, or rearranging the screen elements. You don’t need to be a programmer to be able to accomplish that mission.

Microsoft Dynamics NAV comes with a comprehensive set of tools aimed at modifying the solution and every aspect of it, from the data model, via business logic, all the way to the user interface. Many steps along this way can be done without any programming knowledge.

Let’s take a look at what can be done without writing code:

  • Extending the data model: Application data is stored in tables, which are specifically designed to store exactly that information which is required by the application, no more, no less. When your customer presents you with new requirements, these will often spawn many changes to the underlying data model, to accommodate all those types of information that weren’t originally supposed to be stored, because nobody knew they existed. You can do all of these data model modifications using special data design tools, without writing any code. True, some business logic is usually associated with data, so called business rules, but these should be written much later, after the model has been completed.
  • Modifying the user interface: To put a functional user interface together requires a good understanding of the underlying data model, and of various user interface controls that can be put on screen, what they can do, and what they can’t. You can compose hundreds of fully functional data-enabled pages or forms, and establish complex navigation rules between them, without ever coming anywhere close to the C/AL code editor.
  • Reporting: Again, to compose reports mainly requires good knowledge of the underlying data, and the knowledge of tools. While some complex reports may require extensive coding, the vast majority of reports will be prepared by simply laying out fields in the report designer.
  • Data import and export: When data needs to go in and out of the system, you can reach for built-in development tools that can create data migration objects in a matter of minutes.

One of those times when knowing how to shape the system matters, while coding doesn’t at all, is prototyping. Imagine how quickly you could get the requirements straight with a customer if you were able to quickly compose a usable user interface prototype!

Object Designer basics

All of the development in Microsoft Dynamics NAV is done through the Object Designer feature of the Classic client.

To invoke the Object Designer from anywhere within the application, simply press Shift+F12, or go to main menu, click Tools, then Object Designer. It looks like the following screenshot:

Microsoft Dynamics NAV 2009

To the left there is a series of buttons, which you can use to switch between the lists of objects of various types:

Type

 

Description

 

Microsoft Dynamics NAV 2009

Tables are used to store information in the system.

 

Microsoft Dynamics NAV 2009

Forms are used to provide access to information by displaying it on screen and allowing data entry and modification. Forms can only be used by Classic client.

 

Microsoft Dynamics NAV 2009

Reports are primarily used to display information in printable form, but can also be used to execute batch jobs.

 

Microsoft Dynamics NAV 2009

Dataports are used to export and import information to and from the system in fixed width or variable length text format.

 

Microsoft Dynamics NAV 2009

Dataports on steroids, XMLports are RoleTailored and can get information into or out of the system in XML and text format. XMLports can also be used to automate communication with external application in a way transparent to the users, such as with Business Notifications functionality.

 

Microsoft Dynamics NAV 2009

Codeunits contain blocks of application code: the part of the system popularly called business logic.

 

Microsoft Dynamics NAV 2009

MenuSuites define what the navigation pane in Classic client and the Departments page in the RoleTailored client look like.

 

Microsoft Dynamics NAV 2009

Pages are the forms of the RoleTailored client: they are used to present the information to users and provide means for data entry using RoleTailored or any other service-tier clients (such as SharePoint client).

 

On the right, there is a table displaying all the objects of the selected type. The following columns are on show:

Column

Description

Type

This is actually displayed as an icon, which can represent any of the eight object types described in the previous table.

ID

An integer number representing the unique identifier of an object. Every object in the system is uniquely distinguished from every other by its type and ID.

Name

A textual identifier of the object, which has to be unique for each object type. You typically refer to objects by their names when you are declaring C/AL variables.

Caption

A localized version of the name, aware of the multi-language capabilities of Microsoft Dynamics NAV.

Modified

Tells if the object was modified. Upon saving, every object will automatically get a checkmark in this field.

Version List

A textual list of version tags, explaining which product releases, add-ons, or customizations have changed the object.

Date

Date of the last save operation in Object Designer.

Time

Time of the last save operation in Object Designer.

BLOB Size

Size of BLOB representation of the object in the database. The definition, and for all compiled objects an executable version of it, are saved in the database. This makes for a very portable solution, where the database is, so are the application objects.

Compiled

Flag that tells if the object was compiled, either during the last save operation, or manually by calling the Compile command. Only compiled objects can be executed.

On the bottom right, you have a few basic command buttons: New to create a new object of the selected type, Design to open an existing one, Run to execute the selected object, and Help to answer any questions that we might come across in the process of modifying the system.

LEAVE A REPLY

Please enter your comment!
Please enter your name here