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)

Rec and xRec global variables

In the previous section dedicated to table triggers, we referred to the fields of the current table by simply naming these fields, such as Starting Date, Ending Date, or Customer Group Code. In fact, these fields belong to a global variable, Rec, that always exists within the context of a table and refers to the table instance itself. References to table fields are implicitly resolved to Rec if the record context is not specified explicitly.

Any data manipulation functions are also applied to the context of the current record instance when called without a variable reference. If, for example, we want to make sure that the user fills the item code in the contract line before specifying the amount, we could do it by calling TESTFIELD on the Item No. in the context of the current record. Here is the code to do the validation in the the OnValidate trigger...