O'Reilly logo

Extending Microsoft Dynamics NAV 2016 Cookbook by Alexander Drogin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic C/AL programming

As an example, let's create a simple function that receives a checksum as a parameter and verifies if a check sum satisfies given criteria.

It is a typical task for a developer working on an ERP system to implement verification such as the Luhn algorithm that is widely used to validate identification numbers, such as a credit card number.

How to do it...

  1. In the Object Designer window, create a new codeunit. Assign a number and name (for example, 50000, Luhn Verification).
  2. Click View, then C/AL Globals; in the Globals window open the Functions tab.
  3. In the first line of the table enter the function name, SplitNumber.

    The verification function receives a BigInteger number as an input parameter, but the algorithm works with separate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required