Creating a function

Let's take a quick look at how a function can be created. We'll add a new codeunit to our C/AL application, Codeunit 50000. As this is where we will put any callable functions that we need for our WDTU application, we will simply call it Radio Show Management. In that Codeunit, we'll create a function to calculate a new date based on a given date. If that seems familiar, it's the same thing we did in Chapter 3, Data Types and Fields, to illustrate how a DateFormula data type works. This time, our focus will be on the creation of a function.

When working on projects with larger teams, creating more codeunits is advised to have a better chance of each developer working on seperate objects.

Our first step is to copy Table ...

Get Programming Microsoft Dynamics NAV - Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.