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

Accessing collections with the FOREACH statement


The FOREACH statement, natural in C#, has been introduced in NAV 2016. It is commonly used in C# to iterate on instances of a structure with an enumerator, which is usually introduced by implementing the IEnumerable interface. In NAV 2016, you can apply the same statement to enumerable .NET objects.

How to do it...

Now we will collect a list of table fields that have relations to other tables and show them in a factbox page. Data is retrieved from object metadata in the XML format, and FOREACH comes in handy when iterating on lists of XML nodes:

  1. The page in the following recipe consists of two parts: the main page and a factbox subpage. First we will create the factbox subpage. Create a page in the page designer, choose the ListPart page type, and select the virtual table 2000000041 Field for the data source.

  2. In the page wizard, move two fields to the page, No. and FieldName, and complete the wizard.

  3. In the page properties, set Editable to No and...