Microsoft Dynamics NAV 2009 Programming Cookbook

Microsoft Dynamics NAV 2009 Programming Cookbook
eBook: $35.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $95.98    Print cover: $59.99
save 44%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Write NAV programs to do everything from finding data in a table to integration with an instant messenger client
  • Develop your own .NET code to perform tasks that NAV cannot handle on its own
  • Work with SQL Server to create better integration between NAV and other systems
  • Learn to use the new features of the NAV 2009 Role Tailored Client
  • Easy-to-read recipes with detailed explanations and images
  • Maximize your learning with short tutorials that tell you exactly what you need to know without all of the fluff

Book Details

Language : English
Paperback : 356 pages [ 235mm x 191mm ]
Release Date : October 2010
ISBN : 1849680949
ISBN 13 : 9781849680943
Author(s) : Matt Traxinger
Topics and Technologies : All Books, Enterprise Products and Platforms, Cookbooks, Microsoft Dynamics, Enterprise, Microsoft, .NET

Table of Contents

Chapter 1: Strings, Dates, and Other Data Types
Chapter 2: General Development
Chapter 3: Working with Tables and Records
Chapter 4: Designing Forms
Chapter 5: Report Design
Chapter 6: Diagnosing Code Problems
Chapter 7: Roles and Security
Chapter 8: Leveraging Microsoft Office
Chapter 9: OS Interaction
Chapter 10: Integration
Chapter 11: Working with SQL Server
Chapter 12: The RoleTailored Client
  • Chapter 1: Strings, Dates, and Other Data Types
    • Introduction
    • Retrieving the system date and time
    • Retrieving the work date
    • Determining the day, month, and year from a given date
    • Converting a value to a formatted string
    • Creating an array
    • Creating an Option variable
    • Converting a string to another data type
    • Manipulating string contents
    • Using date formulas to calculate dates
  • Chapter 2: General Development
    • Introduction
    • Repeating code using a loop
    • Displaying a Progress Bar
    • Checking for conditions using an IF statement
    • Using a CASE statement to test multiple conditions
    • Creating a function
    • Passing parameters by reference
    • Referencing dynamic tables and fields
    • Using recursion
  • Chapter 3: Working with Tables and Records
    • Introduction
    • Creating a table
    • Adding a key to a table
    • Creating transactions to alter data
    • Validating data
    • Retrieving a single record from the database
    • Using advanced filtering
    • Retrieving data using FIND
    • Adding a FlowField to a table
    • Creating a SumIndex field
    • Marking records for future use
    • Clearing filters, keys, and values
    • Using temporary tables to store data
    • Retrieving data from another company
    • Merging records
    • Writing your own rollback routine
  • Chapter 4: Designing Forms
    • Introduction
    • Obtaining input without a form
    • Using the Form Generation Wizard
    • Changing text appearance
    • Preventing editable lookup forms
    • Adding an editable field to a non-editable form
    • Creating a matrix form
    • Creating a wizard-style form
    • Designing a form based on a temporary table
    • Updating a subform from a parent form
    • Updating a parent form from a subform
  • Chapter 5: Report Design
    • Introduction
    • Using the Report Generation Wizard
    • Adding custom filters to the request form
    • Setting filters when a report is loaded
    • Creating a report to process data
    • Displaying a check mark on a report
    • Dynamically showing Sections on reports
    • Grouping data to display totals
    • Adding page totals to reports
    • Display page X of Y
    • Using virtual tables to loop through data
    • Adding a watermark to a page
  • Chapter 6: Diagnosing Code Problems
    • Introduction
    • Using the debugger
    • Setting breakpoints
    • Using Code Coverage
    • Handling runtime errors
    • Using Client Monitor to diagnose problems
    • Finding errors when using NAS
    • Implementing Try / Catch / Finally
  • Chapter 7: Roles and Security
    • Introduction
    • Adding roles through the User Setup table
    • Creating and assigning a security role
    • Using FILTERGROUP to restrict data
    • Checking for user-assigned roles
    • Checking Active Directory groups
    • Using security filters
    • Field-level security
    • Assigning menu suites based on company
    • Ending an idle session
    • Automatically adding users to NAV
    • Hiding values in Zoom
  • Chapter 8: Leveraging Microsoft Office
    • Introduction
    • Using the style sheet tool
    • Sending data to Microsoft Word
    • Sending an e-mail from NAV through Outlook
    • Exporting data using the Excel buffer
    • Creating a data connection from Excel to NAV
    • Creating an InfoPath form with NAV data
    • Instant messaging using Office Communicator
    • Creating charts with Visio
  • Chapter 9: OS Interaction
    • Introduction
    • Using HYPERLINK to open external files
    • Working with environment variables
    • Using SHELL to run external applications
    • Browsing for a file
    • Browsing for a folder
    • Checking file and folder access permissions
    • Querying the registry
    • Zipping folders and files within NAV
  • Chapter 10: Integration
    • Introduction
    • Flat file exchange using dataports
    • Sharing information through XMLports
    • Manually writing to and reading from files
    • Creating a web service
    • Consuming web services
    • Sending data through FTP
    • Printing reports to PDF
    • Creating a custom NAS handler
    • Writing your own automation using C#
    • Using ADO to access outside data
  • Chapter 11: Working with SQL Server
    • Introduction
    • Creating a basic SQL query
    • Adding the xp_ stored procedures
    • Understanding SIFT tables
    • Using SQL Profiler
    • Displaying data from a SQL view in NAV
    • Figuring out who is blocking whom
    • Setting up a backup plan
    • Scheduling NAV tasks from SQL Server
  • Chapter 12: The RoleTailored Client
    • Introduction
    • Creating a page using the Page Generation Wizard
    • Building a Role Center
    • Changing default filter columns
    • Building the report layout
    • Interactive sorting for reports
    • Displaying a graph on a report
    • Displaying a .NET add-in on a page

Matt Traxinger

Matt Traxinger graduated from the Georgia Institute of Technology in 2005 with a B.S. in Computer Science, specializing in Human Computer Interaction and Cognitive Science. After college he took a job as an add-on developer using a language he was unfamiliar with for a product he had never heard of: Navision. It turned out to be a great decision.

In the years following Matt learned all areas of the product and earned Microsoft Certified Business Solutions Professional certifications in both technical and functional areas of NAV. He continues to stay current with new releases of the product and is certified in multiple areas for versions 4.0, 5.0, and 2009.

Currently Matt works in Norcross, GA, for Canvas Systems, one of the largest resellers of new and refurbished computer equipment as an in-house NAV Developer and Business Analyst. He supports multiple offices in the United States as well as locations in the United Kingdom and the Netherlands.

In his spare time you can find him on the online communities and under the name MattTrax, helping others learn more about the Dynamics NAV software.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 1 submitted: last submission 29 Apr 2014

Errata type: Typo | Page number: 42

The step 9 should be "Write the following code in the ChangeCustomerNameRef function:" instead of "Write the following code in the ChangeCustomerName function:"


Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Microsoft Dynamics NAV 2009 Programming Cookbook +    (MCTS) Microsoft BizTalk Server (70-595) Certification and Assessment Guide: Second Edition =
50% Off
the second eBook
Price for both: $51.15

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Learn basic programming concepts like variables, loops, and conditionals
  • Build tables and perform complex actions on their data
  • Design different types of forms to display and interact with business data
  • Create reports to present information from multiple areas of the system
  • Write C# .NET code that will work inside the NAV client
  • Learn advanced security techniques including integrating your code with Active Directory
  • Build solutions that work with the entire Microsoft Office suite of products
  • Write code to interact with the Windows file system and registry
  • Create objects to send your data to other applications and read data from other databases
  • Learn to work with SQL Server and execute basic queries against the NAV database
  • Design solutions for the Role Tailored Client


In Detail

Microsoft Dynamics NAV 2009 is a business management solution that helps simplify and streamline highly specialized business processes such as finance, manufacturing, customer relationship management, supply chains, analytics, and electronic commerce for small and medium-sized enterprises. ERP systems like NAV thus become the center of a company's day-to-day operations. When you learn to program in an environment like this it opens up doors to many other exciting areas like .NET programming, SQL Server, and Web Services.

Microsoft Dynamics NAV 2009 Programming Cookbook will take you through interesting topics that span a wide range of areas such as integrating the NAV system with other software applications like Microsoft Office, creating reports to present information from multiple areas of the system, and so on. 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 Web Services.

The first half of the cookbook will help programmers coming to NAV for the first time by walking them through the building blocks of writing code and creating objects like tables, forms, 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 like Microsoft Office or even custom programs. You will also discover some of the features of the Role Tailored Client including creating Pages and custom add-ins.

A set of to-the-point tutorials to quickly teach you what you need to know about NAV Programming


You won't find any fluff here. This book is written in a direct, to-the-point style to help you get what you need and continue working in NAV. At the same time it provides enough explanation so that you understand what we are doing and why it is necessary.

In many programming books you will find yourself searching through paragraph after paragraph to try to find what you are looking for. That's not the case here. Each recipe starts with a short description of what it will teach. It is immediately followed with directions, usually with illustrations, of how to perform the task. You will find the explanation of the code at the end, along with some advice for further reading or other tasks you might be interested in.

Who this book is for

If you are a junior / entry-level NAV developer then the first half of the book is designed primarily for you. You may or may not have any experience programming. It focuses on the basics of NAV programming. It would be best if you have 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 of the NAV box when building solutions.

There are also recipes here and there that senior developers will find useful.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software