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

Subscribing to events in runtime


In all examples of event subscription developed in the current chapter so far, subscription is registered statically at compile time. As soon as the event subscriber codeunit is saved and compiled, it starts to receive event notifications.

Subscription binding can also be controlled from the application code at runtime, so that the subscriber can start and stop subscriptions dynamically.

How to do it...

In this recipe, we will modify the codeunit 50904 Custom Integration Event from the Creating custom events recipe to control the subscription state from the UI.

  1. Start the recipe from creating a new codeunit in NAV object designer.

  2. Open codeunit properties. To do this, press Shift + F4 , or choose the option Properties in the View menu, from any place in the code editor. Change the value of the property EventSubscriberInstance from its default value Static-Automatic to Manual. Close the properties window.

  3. In C/AL Globals declarations, create a function VerifyJournalLineDimensions...