Once you have achieved some mastery in the basics of C/AL programming, you
are ready to start creating your own C/AL in NAV. But it is important that you get
some familiarity with NAV C/AL code in the standard product first. You may recall
the advice in a previous chapter that the new code you create should be visually
and logically compatible with what already exists. If you think of your new code as
a guest being hosted by the original system, you will be doing what any thoughtful
guest does—fitting smoothly into the host's environment.
An equally important aspect of becoming familiar with the existing code is
to increase the likelihood of being able to take advantage of its features and
components to address some of your application requirements. There will be at least
two groups of material that you can use.
One group is the Callable Functions that are used liberally throughout NAV. There
is no documentation for most of those functions so you must either learn about them
here or through doing your homework (i.e. studying NAV code). The second group
includes the many code snippets that you can copy when you face a problem similar
to something the NAV developers have already addressed.
The code snippets differ from the callable functions in two ways. Firstly, they are not
structured as coherent and callable entities. Secondly, they may only apply to your
problem as a model, code that must be modified to fit the situation (e.g. changing
variable names, adding or removing constraints, etc.).
In this chapter, we will look at some of the code structures. We will also discuss
techniques for working with the code, for debugging, and as a developer, taking
advantage of the strengths of the C/SIDE and NAV environment. Following this
chapter, you should have enough tools in your NAV toolkit to start doing basic
development projects.