Book Image

Microsoft Dynamics NAV Development Quick Start Guide

By : Alexander Drogin
Book Image

Microsoft Dynamics NAV Development Quick Start Guide

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. This book gets you started with its integrated development environment for solving problems by customizing business processes. This book introduces the NAV development environment – C/SIDE. It gives an overview of the internal system language and the most essential development tools. The book will enable the reader to customize and extend NAV functionality with C/AL code, design a user interface through pages, create role centers, and build advanced reports in Microsoft Visual Studio. By the end of the book, you will have learned how to extend the NAV data model, how to write and debug custom code, and how to exchange data with external applications.
Table of Contents (10 chapters)

Passing variables by value and by reference

To simplify the example, we will skip the sorting of the input array, but instead generate a random array whose elements are already sorted in ascending order. The GenerateRandomSortedArray function will do this: it simply fills an array with random values, each value greater than the previous one. A generated array is the result that must be returned from the function. But the function return value can only be a scalar; it is not possible to return an array directly as a function value. A ByVar parameter can help us to work around this problem. If we pass an array variable to GenerateRandomSortedArray by reference, any changes made inside the function will be visible to the calling code. Let's see how this works.

Inside the function, declare an InputArray parameter of type Integer and set the checkmark in the Var field. To complete...