You are previewing Learning MS Dynamics AX 2012 Programming.
O'Reilly logo
Learning MS Dynamics AX 2012 Programming

Book Description

Develop and customize your very own Microsoft Dynamics AX solution quickly and efficiently

In Detail

This tutorial has been carefully structured to guide you through the basic features of AX development and get you started as quickly as possible. With this book, you will soon be able to develop and maintain comprehensive management solutions to enhance your Dynamics AX 2012 application's performance. Starting with a tour of the development environment, you'll gain a deep understanding of Dynamics AX tools and architecture, before getting to grips with X++ for deeper customization. You will also learn how to search, manipulate, and integrate data.

The practical examples in this book take you through sample AX development projects and help you learn to create forms, reports, menu items, menus, and navigation pages. The book also helps you work with MorphX. By the end of this book, you will have a better understanding of the inner workings of Microsoft Dynamics AX—making your development simpler and faster, and your applications fast, reliable, and robust.

What You Will Learn

  • Get to grips with the AX development environment
  • Understand the basics of the X++ language
  • Solve the problems of extending as well as upgrading using Events
  • Create transaction headers and line records with a single instruction using the UnitOfWork class
  • Utilize Table Inheritance to synchronize and derive a flexible variety of tables from the base table
  • Effectively handle the transaction scope by using different operators
  • Optimize application performance and extensibility
  • Create services and expose them to external applications
  • Build a new module in AX
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Learning MS Dynamics AX 2012 Programming
      1. Table of Contents
      2. Learning MS Dynamics AX 2012 Programming
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
          3. Instant updates on new Packt books
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Understanding Dynamics AX 2012
        1. Understanding the development environment
          1. Programming language
          2. MorphX
          3. Application Object Tree
            1. Data Dictionary
            2. Macros
            3. Classes
            4. Forms
            5. Datasets
            6. SSRS Reports
            7. Reports
            8. Report Libraries
            9. Queries
            10. Jobs
            11. Menus
            12. Menu Items
            13. Web
            14. Services
            15. Workflow
            16. Resources
            17. System Documentation
          4. Application Developer Documentation
          5. Properties
          6. X++ code editor
          7. Compiler
          8. Labels
        2. Creating your first AX program
        3. Utilizing the different development tools
          1. Cross-references
          2. MorphX version control
            1. Setting up the MorphX version control
            2. Using the MorphX version control
          3. The debugger
        4. Dissecting the AX architecture
          1. Application object layers
          2. Network tiers
        5. Case study – Carz Inc.
        6. Summary
      9. 2. The X++ Language
        1. Introduction
        2. Datatypes
          1. Primitive datatypes
            1. String
              1. The strfmt method
              2. The substr method
            2. Integer
            3. Real
              1. The str2num function
              2. The num2str function
            4. Boolean
            5. Date
            6. Enum
              1. The enum2str function
              2. The enum2int function
            7. The timeofday datatype
              1. The str2time function
            8. The utcdatetime datatype
            9. The anytype datatype
          2. Composite datatypes
            1. Container
              1. The container functions
            2. Class
            3. Table
              1. The find method
              2. The exist method
              3. The initFrom method
            4. Array
        3. Statements and loops
          1. The for loop
          2. The continue statement
          3. The break statement
          4. The while loop
          5. The do-while loop
          6. The if-else if-else loop
          7. The switch statement
          8. Exception handling
        4. Operators
          1. Assignment operators
          2. Relational operators
          3. Arithmetic operators
        5. Classes and methods
          1. Method access
          2. The RunOn property
          3. Static methods
          4. The default parameter
          5. The Args class
          6. Inheritance
          7. The construct method
          8. The main method
          9. The RunBase framework
          10. The SysOperation framework
          11. The collection classes
            1. Array
            2. List
            3. Map
            4. Set
            5. Struct
        6. Macros
        7. Events
        8. Summary
      10. 3. Storing Data
        1. Extended datatypes
          1. Creating an extended datatype
        2. Tables
          1. Creating a table
          2. Adding fields to a table
          3. Adding fields to a field group
          4. Creating an index
          5. Creating a relation
          6. Creating a delete action
          7. Table browser
          8. Table inheritance
            1. Querying data on inherited tables
          9. Valid time state tables
        3. Summary
      11. 4. Data User Interaction
        1. Forms
          1. Main components of a form
            1. Methods
            2. Data sources
            3. Designs
          2. Creating a form with one data source
            1. Form templates
            2. Creating the form
            3. Adding the data source
            4. Creating a form design
          3. Creating a form with two data sources
          4. Separating the design using a form splitter
          5. Display and edit methods
            1. Edit methods
            2. Considerations
            3. Caching display methods
          6. Creating a lookup form
            1. Creating a lookup form by adding a new form in AOT
            2. Creating a lookup in the lookup method
            3. Parts
        2. Reports
          1. Reporting Services
            1. Creating an AX report using Visual Studio
        3. Menu items
          1. Creating a menu item
          2. Using a menu item as a button in a form
        4. Navigation pages
          1. List pages
          2. Creating a list page
        5. Menus
        6. Summary
      12. 5. Searching for Data
        1. Queries
          1. Creating a static query using AOT
            1. Adding a sort order to the query
            2. Adding a range to the query
            3. Joining data sources in the query
          2. Creating a dynamic query using X++
          3. Using a query
        2. Views
          1. Creating a view
        3. The select statement
          1. CarTable
          2. RentalTable
          3. CustTable
          4. How to write a simple select statement
          5. How to use sorting in the select statements
          6. How to use joins in a select statement
            1. The inner join
            2. The outer join
            3. The exists join
            4. The notexists join
          7. How to write aggregate select statements
            1. sum
            2. avg
            3. count
            4. minof and maxof
            5. Group by
        4. Optimizing data retrieval
          1. Using the correct data retrieval method
          2. Field selects
          3. Indexing
          4. Using views to optimize data retrieval
          5. Other ways to improve data retrieval
        5. Summary
      13. 6. Manipulating Data
        1. The validation methods
        2. Record-based manipulation
          1. Insert
          2. Update
          3. Delete
        3. Set-based data manipulation
          1. The insert_recordset operator
          2. The update_recordset operator
          3. The delete_from operator
        4. Unit of work
        5. Direct handling
        6. Summary
      14. 7. Integrating Data
        1. Text files
          1. Writing data to a text file
          2. Reading from a file
        2. Binary files
        3. XML files
          1. Creating an XML file and writing to it
          2. Reading an XML from a file
        4. Open Database Connectivity
          1. Reading data from the database:
          2. Reading from a database using ODBC
          3. Writing to a database using ODBC
        5. The import/export activity
          1. The ImpExpFileDialog class
            1. The classDeclaration method
            2. The dialog method
            3. The getFromDialog method
            4. The pack method
            5. The run method
            6. The unpack method
            7. The main method
          2. The ImpExpFile class
            1. The classDeclaration method
            2. The new method
            3. The openFile method
            4. The readFile method
            5. The run method
            6. The writeFile method
            7. The construct method
          3. The ImpExp_Cars class
            1. The classDeclaration method
            2. The readFile method
            3. The writeFile method
          4. The ImpExp_Rentals class
            1. The classDeclaration method
            2. The readFile method
            3. The writeFile method
        6. Summary
      15. 8. Integrating with Standard AX
        1. The inventory module
          1. The InventTable entity schema
          2. The InventTrans entity schema
        2. Understanding main class hierarchies
          1. The InventMovement classes
          2. The InventUpdate classes
          3. The InventAdj classes
          4. The InventSum classes
        3. Working with inventory dimensions
          1. Finding an inventory dimension
          2. Finding the current on-hand information
          3. Finding on-hand information by a specific date
          4. Entering and posting an inventory journal from code
        4. The Ledger module
          1. Posting ledger transactions
          2. Entering and posting a LedgerJournal class
          3. Entering and posting a LedgerVoucher class
        5. Understanding the Accounts Receivable / Accounts Payable modules
          1. Entity schema – base data and orders
          2. Entity schema – transactions
        6. The trade agreements
        7. Finding the price of an item for a specific customer
        8. Posting and printing sales/purchase updates
        9. The voucher settlement
        10. Summary
      16. 9. Creating a New Module
        1. Setting up a number sequence reference
        2. The parameter table
          1. Setting up the number sequence
          2. Using the number sequence
        3. The security framework
          1. License codes
          2. Configuration keys
          3. The security hierarchy
            1. Code permission
            2. Privileges
            3. Duties
            4. Policies
            5. Roles
            6. Process cycles
        4. Summary
      17. 10. Working with .NET and AX
        1. Common Language Runtime
          1. Adding a reference to a .NET class in AX
            1. Assembly existing in the Global Assembly Cache
            2. Assembly not in Global Assembly Cache
          2. Using a .NET class in X++
        2. .NET Business Connector
          1. Using .NET Business Connector in .NET classes
            1. Creating a static method in AX in the global class
          2. Creating a new project in Visual Studio and adding it to AOT
            1. Application Explorer
            2. Inserting data in an AX table
            3. Reading data from an AX table
            4. Exception classes
        3. Summary
      18. 11. Web Services
        1. Exposing AX logic using web services
          1. Creating a web service that exposes the AX logic
          2. Publishing a web service to IIS
        2. Accessing logic in an external web service
          1. Creating a service reference
          2. Creating a class that consumes the web service
        3. Summary
      19. 12. Enterprise Portal
        1. Creating a dataset
        2. Creating a new Visual Studio project
        3. Creating a grid
        4. Creating a new Web Part page
        5. Creating a tunnel/wizard
        6. Summary
      20. A. Links
        1. Websites
          1. Official Microsoft websites
          2. Blogs
          3. Other relevant websites
      21. B. Debugger
      22. Index