Getting used to the AL language for Dynamics NAV 2018   July 18th, 2018

In the previous post, Setting up Dynamics NAV 2018 for Testing and Development in Docker we have covered how to setup a development and testing environment, and had our first steps with Visual Studio Code to publish our first hello world application.

Now I want to show you some AL language thing that might be useful. You can see them in action in the example app ALBasics: https://github.com/TBits/Al-examples/tree/master/ALBasics

There are test procedures illustrating how to:

  • Working with basic constructs like “if”
  • Format various types of variables to string (known as Text), using Format(), or StrSubstNo().
  • Parse Integer to String with Evaluate()
  • Working with Date and DateTime, getting the current Now with CurrentDateTime or Today with Today. Comparing dates, even by a given difference in for example days, with CalcDate(). Converting between DateTime and Date, with DT2Time(), and setting a date with DMY2DATE().
  • How to work with options: calling a procedure with an option parameter, and the issues you can get if you have different definitions of the options.
  • How to call procedures with reference parameters (keyword var), and how to return a result either by a named variable or with exit(<value>)
  • How to call a procedure that is defined inside a code unit.
Tags: ,
This entry was posted on Wednesday, July 18th, 2018 at 10:38 pm and is filed under Software Development. You can follow any responses to this entry through the RSS 2.0 feed.Both comments and pings are currently closed.

No Responses