I had a dream: codeunit references

Polymorphism is a great thing. .NET, Java, C++ and other folks have enjoyed its benefits for a long time, some more than a quarter century already. Meanwhile, we, the meager C/AL bunch, can only dream about it and draft our little patterns that all come short…

Using Codeunits as Classes

This time, I’ll present you with another way to use Codeunits in NAV. By using Codeunits as parameters to a function, you can use Codeunits as (sort of .NET) Classes. If you declare different local variables to the same Codeunit, they even have their own version.…

When Changing a Codeunit Subtype

Since a couple of years codeunits have a property called Subtype. Selecting a specific value for this property changes the behavior of the codeunit, one of them being an extra property added to functions, i.e. FunctionType (for Test Codeunits and Upgrade Codeunits) which defaults to a…