Book Image

Extending Microsoft Dynamics NAV 2016 Cookbook

By : Alexander Drogin
Book Image

Extending Microsoft Dynamics NAV 2016 Cookbook

By: Alexander Drogin

Overview of this book

Microsoft Dynamics NAV is an enterprise resource planning (ERP) software suite for organizations. The system offers specialized functionality for manufacturing, distribution, government, retail, and other industries. Its integrated development environment enables customizations with minimal disruption to business processes. The book starts explaining the new features of Dynamics NAV along with how to create and modify a simple module. Moving on, you will learn the importance of thinking beyond the boundaries of C/AL development and the possibilities opened by with it. Next, you will get to know how COM can be used to extend the functionalities of Dynamics NAV. You’ll find out how to extend the Dynamics NAV 2016 version using .NET interoperability and will see the steps required to subscribe to .NET events in order to extend Dynamics NAV. Finally, you’ll see the cmdlets available to manage extension packages. By the end of the book, you will have the knowledge needed to become more efficient in selecting the extending methods, developing and deploying them to the Dynamics NAV, and practicing the best practices.
Table of Contents (17 chapters)
Extending Microsoft Dynamics NAV 2016 Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

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 designer and insert two action buttons: GetProcessorSpeed and GetMemorySize.

  3. Open the C/AL code designer and access the list of global variables. Declare an Automation variable:

    Name

    DataType

    Subtype

    ShellControl

    Automation

    Microsoft Shell...