You are previewing Programming Microsoft® Dynamics™ NAV 2009.
O'Reilly logo
Programming Microsoft® Dynamics™ NAV 2009

Book Description

Develop and maintain high performance NAV applications to meet changing business needs with improved agility and enhanced flexibility

  • Create, modify, and maintain smart NAV applications to meet your client's business needs

  • Thoroughly covers the new features of NAV 2009, including Service Pack 1

  • Focused on development for the three-tier environment and the Role Tailored Client

  • For experienced programmers with little or no previous knowledge of NAV development

  • Contains detailed documentation and explanations – with useful examples – not readily available elsewhere

  • In Detail

    Microsoft Dynamics NAV is a well established Enterprise Resource Planning (ERP) application, part of the Microsoft Dynamics family. Dynamics NAV is installed worldwide, with well over one million users. Version 2009 contains many major new features and structures, requiring even experienced Dynamics NAV developers to refresh their NAV development knowledge.

    Renowned for its challenging learning curve, Dynamics NAV is a complex piece of software with a unique design structure. For developers learning to modify or enhance Dynamics NAV for vital business purposes, the task can sometimes be intimidating.

    This book is an in-depth step-by-step guide to programming NAV, designed to ease you through the complexities of NAV application development. You will learn the skills and develop the confidence to tackle your own critical NAV applications. This book will act as your experienced NAV programming mentor, helping you to become productive as a NAV developer much more quickly.

    NAV development is quite complex, with a steep learning curve. This book makes it easy for you. From basic NAV terminology and concept definitions, through the essential building blocks of NAV data structure and objects, you will gain an understanding of the fundamental underlying concepts of NAV. You will learn practical details about NAV object construction and the tools available, including table, page, and report design. You will learn how to use NAV's tools to effectively navigate through the various features of objects, including properties, triggers, and C/AL code, and receive practical guidance on ways to develop and test in the unique NAV C/SIDE development environment.

    Extensive guidance on software design for NAV is provided along with tips for efficient design of new NAV applications or enhancing existing applications. With its comprehensive collection of NAV information and distillation of years of NAV development experience, this book is not only designed to help you learn, but to act as a reference as well.

    Table of Contents

    1. Programming Microsoft® Dynamics™ NAV 2009
    2. Credits
    3. About the Author
    4. Acknowledgement
    5. About the Reviewers
    6. Foreword
    7. Preface
      1. A business history timeline
      2. The beginning
      3. Single user PC Plus
      4. Multi-user Navigator
      5. Navision Financials for Windows
      6. Growth and mergers
      7. Continuous enhancement
      8. C/AL's roots
      9. What you should know
      10. What this book covers
      11. What you need for this book
      12. Who this book is for
      13. Conventions
      14. Reader feedback
      15. Customer support
        1. Errata
        2. Piracy
        3. Questions
    8. 1. A Short Tour through NAV 2009
      1. NAV 2009: An ERP system
        1. Financial Management
        2. Manufacturing
        3. Supply Chain Management (SCM)
        4. Business intelligence and reporting
        5. Relationship Management (RM)
        6. Human Resource management
        7. Project management
      2. Significant changes in NAV 2009
        1. Two-tier versus three-tier
        2. Role Tailored Client
        3. SSRS-compatible report viewer
        4. Web services
      3. NAV 2009: A set of building blocks and development tools
        1. NAV object types
      4. The C/SIDE Integrated Development Environment
        1. Object Designer tool icons
        2. NAV object and system elements
        3. NAV functional terminology
      5. User interfaces
      6. An introduction to development
        1. Our scenario for development exercises
        2. Getting started with application design
          1. Application tables
          2. Designing a simple table
          3. Creating a simple table
          4. Field numbering
          5. Pages/Forms
            1. List pages
            2. Card pages
            3. Document pages
            4. Journal/Worksheet pages
            5. Standard elements of pages
            6. Creating a Card page
            7. Creating a List page
          6. Keyboard shortcuts
          7. Run a table
          8. Reports
          9. Creating a List format report
      7. Codeunits
      8. MenuSuites
      9. Dataports
      10. XMLports
      11. Integration tools
      12. Backups and documentation
      13. Summary
      14. Review questions
    9. 2. Tables
      1. Overview of tables
        1. Components of a table
        2. Table naming
        3. Table numbering
        4. Table properties
        5. Table triggers
        6. Keys
        7. SumIndexFields
        8. Field Groups
      2. Expanding our sample application
        1. Creating and modifying tables
          1. Assigning a TableRelation property
          2. Creating Forms for testing
            1. Creating a Card form
            2. Creating List Forms
            3. The ZUP file
            4. Testing a TableRelation property
        2. Adding Secondary keys
        3. Adding some activity-tracking tables
        4. New tables
        5. Keys and SumIndexFields in our examples
            1. Table integration
      3. Types of tables
        1. Wholly modifiable tables
          1. Master
          2. Journal
          3. Template
          4. Ledger
          5. Reference
          6. Register
          7. Posted Document
          8. Setup
          9. Temporary
        2. Content-modifiable tables
          1. System
        3. Read-Only tables
          1. Virtual
      4. Summary
      5. Review questions
    10. 3. Data Types and Fields for Data Storage and Processing
      1. Basic definitions
      2. Fields
        1. Field properties
        2. Field numbering
          1. Changing the data type of a field
        3. Field triggers
        4. Data structure examples
        5. Variable naming
      3. Data types
        1. Fundamental data types
          1. Numeric data
          2. String data
          3. Date/Time data
        2. Complex data types
          1. Data structure
          2. Objects
          3. Automation
          4. Input/Output
          5. DateFormula
          6. References and other
        3. Data type usage
      4. FieldClass property options
      5. Filtering
        1. Defining filter syntax and values
          1. Filtering on equality and inequality
          2. Filtering by ranges
          3. Filtering with Boolean operators
          4. Filtering with wildcards
          5. Filtering with combinations
          6. Experimenting with filters
          7. Accessing filter controls
            1. Classic Client filter access
            2. RoleTailored Client filter access
            3. Find-As-You-Type filtering
      6. Summary
      7. Review questions
    11. 4. Pages—Tools for Data Display
      1. What is a page?
        1. Controls
        2. Bound and unbound
      2. Pages—a stroll through the gallery
        1. A sample RoleTailored Client page
      3. Types of pages
        1. List page
        2. Card page
        3. Document page
          1. FastTab
        4. List+ page
        5. Journal/Worksheet page
        6. Confirmation (Dialog) page
        7. Request page
        8. Navigate page
        9. Departments page
        10. Role Center page
        11. Page parts
          1. FactBoxes
            1. Card parts and List parts
            2. Chart pane
        12. Page names
        13. Accessing the Page Designer
        14. What makes up a page?
          1. Page properties
      4. Types of page controls
        1. Inheritance
        2. Page control details
          1. Container controls
          2. Group controls
          3. Field controls
          4. Using page controls in a Card page
          5. Page Part controls
            1. Creating a Card Part FactBox
            2. Page Control triggers
      5. Adding more List pages to our ICAN application
        1. Creating a simple list page
        2. Creating related List and Card pages
      6. Learning more about pages
        1. UX (User Experience) Guidelines
        2. Creative plagiarism
      7. Experimenting with page controls and control properties
        1. Help searching
        2. Experimentation
        3. Testing
        4. Design
      8. Summary
      9. Review questions
    12. 5. Reports
      1. What is a report?
      2. Two NAV report designers
        1. A hybrid report designer
      3. NAV report—look and feel
      4. NAV report types
        1. Report types summarized
      5. Report naming
      6. Report components overview
        1. The components of a report description
      7. Report Data Flow
      8. The elements of a report
        1. Report properties
        2. Report triggers
        3. Data Items
        4. Data item properties
        5. Data item triggers
        6. Data item Sections
        7. Creating RTC reports via the Classic Report Wizard
          1. Learn by experimentation
          2. Runtime formatting
          3. Inheritance
        8. Other ways to create RTC reports
        9. Modify an existing RTC report
          1. The Visual Studio Report Designer layout screen
            1. Table Elements—icons and purpose
          2. Report Items
          3. Make the report changes
            1. Some interactive report capabilities
            2. Page Header fields
        10. Request Page
      9. Processing-Only reports
          1. Creating a report from scratch
        1. Creative report plagiarism
      10. Summary
      11. Review questions
    13. 6. Introduction to C/SIDE and C/AL
      1. Essential navigation
        1. Object Designer
          1. Starting a new object
            1. Table Designer
            2. Page Designer
            3. Report Designer
            4. XMLport Designer
            5. Codeunit Designer
            6. MenuSuite Designer
          2. Some designer navigation pointers
          3. Exporting objects
          4. Importing objects
          5. Text objects
        2. Object number licensing
        3. Some useful practices
        4. Changing data definitions
        5. Saving and compiling
        6. Some C/AL naming conventions
        7. Variables
          1. Global identifiers
          2. Local identifiers
            1. Function local identifiers
            2. Other local identifiers
          3. Special working storage variables
            1. Temporary tables
            2. Arrays
            3. Initialization
            4. System-defined variables
        8. A definition of programming in C/SIDE
        9. Functions
        10. Basic C/AL syntax
          1. Assignment and punctuation
          2. Wildcards
          3. Expressions
          4. Operators
            1. Arithmetic operators and functions
            2. Boolean operators
            3. Relational operators and functions
            4. Precedence of operators
      2. Some basic C/AL
        1. MESSAGE, ERROR, CONFIRM, and STRMENU functions
          1. MESSAGE function
          2. ERROR function
          3. CONFIRM function
          4. STRMENU function
        2. SETCURRENTKEY function
        3. SETRANGE function
        4. GET function
        5. FIND
          1. FIND ([Which]) options and the SQL Server alternates
        6. BEGIN—END compound statement
        7. IF—THEN—ELSE statement
        8. Indenting code
      3. Some simple coding modifications
        1. Adding a validation to a table
        2. Adding code to enhance a report
      4. Summary
      5. Review questions
    14. 7. Intermediate C/AL
      1. Some C/AL development tools
        1. C/AL Symbol Menu
        2. Internal documentation
      2. Computation and Validation utility functions
        1. TESTFIELD
        2. FIELDERROR
        3. VALIDATE
        4. ROUND
        5. TODAY, TIME, and CURRENTDATETIME functions
        6. WORKDATE function
      3. Data conversion functions
        1. FORMAT function
        2. EVALUATE function
      4. DATE functions
        1. DATE2DMY function
        2. DATE2DWY function
        3. DMY2DATE and DWY2DATE functions
        4. CALCDATE function
      5. FlowField-SumIndexField functions
        1. CALCFIELDS function
        2. CALCSUMS function
      6. CALCFIELDS and CALCSUMS comparison
      7. Flow control
        1. REPEAT—UNTIL control structure
        2. WHILE—DO control structure
        3. CASE—ELSE statement
        4. WITH—DO statement
        5. QUIT, BREAK, EXIT, SKIP, and SHOWOUTPUT functions
          1. QUIT function
          2. BREAK function
          3. EXIT function
          4. SKIP function
          5. SHOWOUTPUT function
      8. Input and Output functions
        1. NEXT function with FIND or FINDSET
        2. INSERT function
        3. MODIFY function
          1. Rec and xRec
        4. DELETE function
        5. MODIFYALL function
        6. DELETEALL function
      9. Filtering
        1. SETRANGE function
        2. SETFILTER function
        3. COPYFILTER and COPYFILTERS functions
        4. GETFILTER and GETFILTERS functions
        5. MARK function
        6. CLEARMARKS function
        7. MARKEDONLY function
        8. RESET function
          1. Filter Groups
      10. InterObject communication
        1. Communication via data
        2. Communication through function parameters
        3. Communication via object calls
      11. Using the new knowledge
        1. A development challenge for you
          1. Creating more ICAN test data
            1. "Donor Giving" report design
            2. Beginning development
            3. Eliminating the Request form/page
            4. Working storage definition
            5. Defining the C/AL code
          2. Developing the Donor Recognition Status report
            1. Using the Report Wizard
            2. Beginning the C/AL coding for the report
            3. Retrofitting date filtering capability
            4. Adding code for CALCFIELDS processing
            5. Adding code to print addresses
      12. Summary
      13. Review questions
    15. 8. Advanced NAV Development Tools
      1. NAV process flow
        1. Data preparation
        2. Transactions entry
        3. Testing and Posting the Journal batch
        4. Accessing the data
        5. Ongoing maintenance
      2. Role Center pages
        1. Role Center structure
          1. Role Center activities page
          2. Cue Groups and Cues
          3. Cue source table
          4. Cue Group Actions
        2. System Part
        3. Page Part
        4. Navigation Pane and Action Menus
        5. Departments
          1. MenuSuite levels
        6. MenuSuite structure
          1. MenuSuite development
          2. MenuSuite transformation
          3. Configuration and personalization
      3. Creating new C/AL routines
      4. Callable functions
        1. Codeunit 358—Date Filter-Calc
        2. Codeunit 359—Period Form Management
        3. Codeunit 365—Format Address
        4. Codeunit 396—NoSeriesManagement
        5. Codeunit 397—Mail
        6. Codeunit 408—Dimension Management
        7. Codeunit 412—Common Dialog Management
      5. Sampling of function models to review
        1. Codeunit 228—Test Report-Print
        2. Codeunit 229—print documents
        3. Other objects to review
        4. Management codeunits
      6. Documenting modifications
      7. Multi-language system
      8. Multi-currency system
      9. Code analysis and debugging tools
        1. Developer's Toolkit
          1. Relations to Tables
          2. Relations from Objects
          3. Source Access
          4. Where Used
          5. Trying it out
        2. Working in exported text code
        3. Using Navigate
          1. Testing with Navigate
            1. Modifying for Navigate
        4. The C/SIDE Debugger
        5. The C/SIDE Code Coverage tool
        6. Client Monitor
        7. Debugging NAV in Visual Studio
        8. Dialog function debugging techniques
          1. Debugging with MESSAGE
          2. Debugging with CONFIRM
          3. Debugging with DIALOG
          4. Debugging with text output
          5. Debugging with ERROR
        9. C/SIDE test driven development
      10. Summary
      11. Review questions
    16. 9. Extend, Integrate, and Design—into the Future
      1. Interfaces
      2. XMLports
        1. XMLport components
          1. XMLport properties
          2. XMLport triggers
          3. XMLport data lines
          4. XMLport line properties
            1. SourceType as Text
            2. SourceType as Table
            3. SourceType as Field
          5. Element or attribute
            1. NodeType as an Element
            2. TagType as an Attribute
          6. XMLport line triggers
            1. DataType as Text
            2. DataType as Table
            3. DataType as Field
          7. XMLport Request Page
      3. Advanced interface tools
        1. Automation Controller
        2. NAV Communication Component
        3. Linked Server Data Sources
        4. C/OCX
        5. C/FRONT
        6. NAV Application Server (NAS)
      4. Client Add-ins
        1. Client Add-in definition
        2. Client Add-in construction
        3. Client Add-in comments
      5. Web services
        1. Exposing a web service
        2. Publishing a web service
        3. Determining what was published
      6. Customizing Help
      7. NAV development projects
        1. Knowledge is key
        2. Different approaches for different scopes
        3. Advantages of designing new functionality
        4. Modifying an existing functional area
        5. NAV development time planning
      8. Data-focused design
        1. Determining the data needs
        2. Defining the needed data views
        3. Designing the data tables
        4. Designing the user data access interface
        5. Designing the data validation
        6. Data design review and revision
        7. Designing the Posting processes
        8. Designing the supporting processes
        9. Double-check everything
      9. Design for efficiency
        1. Disk I/O
        2. Locking
      10. Design for updating
        1. Customization project recommendations
          1. One change at a time
          2. Testing thoroughly
            1. Database testing approaches
            2. Testing in production
            3. Using a testing database
            4. Testing techniques
            5. Deliverables
            6. Finishing the project
      11. Plan for upgrading
        1. Benefits of upgrading
        2. Coding considerations
          1. Careful naming
          2. Good documentation
          3. Low-impact coding
        3. The upgrade process
          1. Upgrade executables only
          2. Full upgrade
      12. Supporting material
        1. Sure Step
        2. RIM
        3. Other reference material
      13. Into the future...
      14. Summary
      15. Review questions
    17. A. Answers
      1. Chapter 1
      2. Chapter 2
      3. Chapter 3
      4. Chapter 4
      5. Chapter 5
      6. Chapter 6
      7. Chapter 7
      8. Chapter 8
      9. Chapter 9