Book Image

Microsoft Dynamics NAV 7 Programming Cookbook - Second Edition

Book Image

Microsoft Dynamics NAV 7 Programming Cookbook - Second Edition

Overview of this book

Microsoft Dynamics NAV 7 is a business management solution that helps simplify and streamline highly specialized business processes. Learning NAV programing in NAV 7 gives you the full inside view of an ERP system. Microsoft Dynamics NAV 7 Programming Cookbook covers topics that span a wide range of areas such as integrating the NAV system with other software applications including Microsoft Office, and creating reports to present information from multiple areas of the system,. We will not only learn the essentials of NAV programming, you will also be exposed to the technologies that surround NAV including.NET programming, SQL Server and NAV system administration. Microsoft Dynamics NAV 7 Programming Cookbook is written in a direct, to-the-point style to help you get what you need and continue working in NAV. The first half of the cookbook will help programmers using NAV for the first time, by walking them through the building blocks of writing code and creating objects such as tables, pages, and reports. The second half focuses on using the technologies surrounding NAV to build better solutions. You will learn how to write .NET code that works with the NAV system and how to integrate the system with other software applications such as Microsoft Office or even custom programs. You will learn everything you need to know for developing all types of NAV CSIDE objects, as well as how to integrate and maintain a NAV system.
Table of Contents (20 chapters)
Microsoft Dynamics NAV 7 Programming Cookbook
Credits
About the Author
About the Reviewers
Acknowledgements
www.PacktPub.com
Preface
Index

Preface

Microsoft Dynamics NAV 7 is a product of the Microsoft Dynamics family. It's a business management solution that helps simplify and streamline business processes, such as finance, manufacturing, customer relationship management, supply chains, analytics, and electronic commerce for small and medium-sized enterprises. Microsoft Dynamics partners can have full access to the source code, which is very easy to customize. Learning NAV programming in NAV 7 will give a full inside view of the ERP system and open doors to many other exciting areas.

The Microsoft Dynamics NAV 7 Programming Cookbook will take you through interesting topics that span a wide range of areas, for example, integrating the NAV system with other software applications, such as Microsoft Office and creating reports to present information from multiple areas of the system. You will not only learn the basics of NAV programming, but you will also be exposed to the technologies that surround the NAV system, such as .NET programming, SQL Server, and NAV system administration.

The first half of the cookbook will help programmers using NAV for the first time by walking them through the building blocks of writing code and creating objects, such as tables, pages, and reports.

The second half focuses on using the technologies surrounding NAV to build better solutions and administration of the NAV service tier. You will learn how to write .NET code that works with the NAV system and how to integrate the system with other software applications, such as Microsoft Office or even custom programs.

What this book covers

Chapter 1, String, Dates, and Other Data Types, describes the method of working with the most common data types. You will learn how to use the functions related to data types. Every recipe includes actual NAV code with a brief explanation about code that will make the data type learning process very interesting.

Chapter 2, General Development, covers the C/AL development structure that includes loops, conditional statements, functions, and so on. You will find some recipes describing C/AL specific commands and functions.

Chapter 3, Working with Tables, Records, and Queries, focuses on the database structure and data retrieval. You will learn how to design a table using filters to retrieve specific data. This chapter will also discuss new object type Query.

Chapter 4, Designing Pages, focuses on data presentation using pages. You will learn how to develop different types of pages including Role Center, Queue, wizard, and many more.

Chapter 5, Report Design, explains how to design an RDLC report. You will find recipes describing the process of adding a request page, setting filters, linking two reports and many more interesting topics related to reports.

Chapter 6, Diagnosing Code Problems, explains how to use built-in tools to debug code problems. You will also learn about debugging the NAV application server.

Chapter 7, Roles and Security, focuses on NAV user security, which includes creating roles and assigning permissions to a role. It will also explain about security filters and filter groups.

Chapter 8, Leveraging Microsoft Office, describes different methods to integrate with the Microsoft Office suite, which includes Word, Excel, InfoPath, and Visio.

Chapter 9, OS Interaction, focuses on different ways to integrate with the Windows operating systems. You will learn how to search the filesystem as well as how to query the system registry.

Chapter 10, Integration, describes different ways of integrating NAV with other applications. You will learn how to exchange data using flat file and XMLport. You will find a recipe describing how to use ADO to access data stored in other databases.

Chapter 11, Working with the SQL Server, provides an introduction to the SQL Server environment. You will learn about writing queries, configuring automated backups, and maintaining SQL logfiles. There is a recipe that will help you to understand the Sum Index Field Technology.

Chapter 12, NAV Server Administration, will help you to learn and understand the NAV service tier. It will also explain about creating a user and maintaining a NAV license.

What you need for this book

The following software are required for the recipes in this book:

  • Microsoft Dynamics NAV 7 with developer license

  • Microsoft SQL Server 2008 R2

  • Microsoft Visual Studio 2010

  • Microsoft Office 2010

Who this book is for

If you are an entry-level NAV developer, then the first half of the book is designed primarily for you. You may or may not have any experience in programming. It focuses on the basics of NAV programming. It would be best if you have already gone through a brief introduction to the NAV client.

If you are a mid-level NAV developer, you will find the second half more useful. These chapters explain how to think outside the NAV box when building solutions. Towards the end of the book, we will learn NAV server tier configuration.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The sp_who command returns a list of all connections to the server by querying the sys.sysprocesses system table."

A block of code is set as follows:

Customer.RESET;
IF Customer.FINDSET THEN
  REPEAT
  CustCount:=CustCount+1;
  UNTIL Customer.NEXT=0;
  MESSAGE('There are %1 customers in the database',CustCount);

Any command-line input or output is written as follows:

sn.exe -T "C:\Program Files (x86)\Microsoft Dynamics NAV\70\
RoleTailored Client\Add-ins\NAV_RSS.dll"

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "From the Tools menu in the NAV client select Debugger | Debug Session (Shift + Ctrl + F11)".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.