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

Writing C/AL code in a report


The report designed in the previous example retrieved data from a database table and presented the result without extra manipulation. It is as simple as that, when the data the users require does not have to be transformed.

Getting ready

The file name in the source files is REP50020_SalesByCustomerItem.txt.

How to do it...

Now we will create a report that collects aggregated data into a temporary record to calculate values that cannot be retrieved from a table directly. Aggregated values are computed by C/AL code executed in report triggers.

  1. Create a report object in NAV Object Designer.

  2. Declare a global variable TempValueEntry of Record type and SubType = Value Entry. This is a temporary buffer where aggregated report amounts will be stored. Open its properties and set Temporary to Yes.

  3. Create a data item with the Customer table as the data source.

  4. Under the Customer data item, add another one and set the data source to Item Ledger Entry. Open data item properties...