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

Working with single instance codeunits

A single instance codeunit is an implementation of the singleton design pattern, an object that can be instantiated only once; all application objects referring to the singleton will reuse the same instance throughout the application.

Typically single instance codeunits are used to store an instance of an external dotNet component that cannot be instantiated twice, such as the Outlook application. Another example of a singleton object is a storage of user settings data, received from an external source.

How to do it...

In this recipe we will use a single instance codeunit to store user configuration read from an XML file. Configuration will include default date range for the Item Profit page used to report profits ...

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