Microsoft Dynamics NAV 2009 Programming Cookbook

Build better business applications with Microsoft Dynamics NAV 2009 with this book and eBook

Microsoft Dynamics NAV 2009 Programming Cookbook

Cookbook
Matt Traxinger

Build better business applications with Microsoft Dynamics NAV 2009 with this book and eBook
$35.99
$54.00
RRP $35.99
RRP $59.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849680943
Paperback356 pages

About This Book

  • 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

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.

Table of Contents

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

What You Will Learn

  • 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.

Authors

Table of Contents

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

Book Details

ISBN 139781849680943
Paperback356 pages
Read More