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

Disposing of COM objects

A C/AL variable of the Automation type is only a reference to a COM object that is created and disposed in runtime. Object instances are created with the CREATE function, and destroyed by the Garbage Collector when the variable leaves the scope. Sometimes it is necessary to destroy an object instance explicitly or ensure that the instance does not exist before calling the CREATE function on the variable. C/AL functions disposing of automation objects will be described in the current recipe.

How to do it...

  1. A new page will be required for the following example. Create a blank page in C/SIDE. This is only a container for action buttons, so choose to create a blank page without any source table or wizard.
  2. Open the page actions ...

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