You are previewing Inside Microsoft Dynamics® AX 2012.
O'Reilly logo
Inside Microsoft Dynamics® AX 2012

Book Description

Dig into the architecture and internals of Microsoft Dynamics AX 2012—with firsthand insights from the team that designed and developed it. Targeted for solution developers and system implementers, this guide focuses on programming and customization capabilities—including key architectural principles, the application model, framework, and tools.

Topics include:

  • Architecture and development environment, including MorphX

  • Microsoft Visual Studio tools for Microsoft Dynamics AX

  • X++ programming language

  • Microsoft SQL Server reporting and analytics

  • Models

  • Core development concepts

  • Extending and customizing Microsoft Dynamics AX

  • Performance and security considerations

  • Workflow

  • Best practices

  • Note: Readers should have working knowledge of SQL and OOP concepts to gain max benefit from this book.

    Table of Contents

    1. Inside Microsoft Dynamics® AX 2012
    2. A Note Regarding Supplemental Files
    3. Foreword
    4. Introduction
      1. The history of Microsoft Dynamics AX
      2. Who should read this book
        1. Assumptions
      3. Who should not read this book
      4. Organization of this book
      5. Conventions and features in this book
      6. System requirements
      7. Code samples
        1. Installing the code samples
        2. Using the code samples
      8. Acknowledgments
        1. Microsoft Dynamics product team
        2. Microsoft Press
        3. New arrivals
      9. Errata & book support
      10. We want to hear from you
      11. Stay in touch
    5. I. A Tour of the Development Environment
      1. 1. Architectural Overview
        1. Introduction
        2. Microsoft Dynamics AX five-layer solution architecture
        3. Microsoft Dynamics AX application platform architecture
          1. Application development environments
          2. Data tier of the Microsoft Dynamics AX platform
          3. Middle tier of the Microsoft Dynamics AX platform
          4. Presentation tier of the Microsoft Dynamics AX platform
        4. Microsoft Dynamics AX application meta-model architecture
          1. Application data element types
          2. MorphX user interface control element types
          3. Workflow element types
          4. Code element types
          5. Services element types
          6. Role-based security element types
          7. Web client element types
          8. Documentation and resource element types
          9. License and configuration element types
      2. 2. The MorphX Development Environment and Tools
        1. Introduction
        2. Application Object Tree
          1. Navigate through the AOT
          2. Create elements in the AOT
          3. Modify elements in the AOT
          4. Refresh elements in the AOT
          5. Element actions in the AOT
          6. Element layers and models in the AOT
        3. Projects
          1. Create a project
          2. Automatically generate a project
            1. Group masks
            2. Filters
            3. Development tools
          3. Project types
        4. Property sheet
        5. X++ code editor
          1. Shortcut keys
          2. Editor scripts
        6. Label editor
          1. Create a label
          2. Reference labels from X++
        7. Code compiler
        8. Best Practices tool
          1. Rules
          2. Suppress errors and warnings
          3. Add custom rules
        9. Debugger
          1. Enable debugging
          2. Debugger user interface
          3. Debugger shortcut keys
        10. Reverse Engineering tool
          1. UML data model
          2. UML object model
          3. Entity relationship data model
        11. Table Browser tool
        12. Find tool
        13. Compare tool
          1. Start the Compare tool
          2. Use the Compare tool
          3. Compare APIs
        14. Cross-Reference tool
        15. Version control
          1. Element life cycle
            1. Quality checks
            2. Source code casing
          2. Common version control tasks
          3. Work with labels
          4. Synchronize elements
          5. View the synchronization log
          6. Show the history of an element
          7. Compare revisions
          8. View pending elements
          9. Create a build
          10. Integrate Microsoft Dynamics AX with other version control systems
      3. 3. Microsoft Dynamics AX and .NET
        1. Introduction
        2. Use third-party assemblies
          1. Use strong-named assemblies
          2. Reference a managed DLL from Microsoft Dynamics AX
          3. Code against the assembly in X++
        3. Write managed code
          1. Debug managed code
          2. Proxies
        4. Hot swap assemblies on the server
      4. 4. The X++ Programming Language
        1. Introduction
        2. Jobs
        3. The type system
          1. Value types
          2. Reference types
          3. Type hierarchies
            1. The anytype type
            2. The common type
            3. The object type
            4. Extended data types
        4. Syntax
          1. Variable declarations
          2. Expressions
          3. Statements
            1. Data-aware statements
            2. Exception handling
            3. Interoperability
            4. CLR interoperability
            5. COM interoperability
          4. Macros
          5. Comments
          6. XML documentation
        5. Classes and interfaces
          1. Fields
          2. Methods
          3. Delegates
          4. Pre- and post-event handlers
          5. Attributes
        6. Code access security
        7. Compiling and running X++ as .NET CIL
        8. Design and implementation patterns
          1. Class-level patterns
            1. Parameter method
            2. Constructor encapsulation
            3. Factory
            4. Serialization with the pack and unpack methods
          2. Table-level patterns
            1. Find and exists methods
            2. Polymorphic associations
            3. Generic record reference
    6. II. Developing with Microsoft Dynamics AX
      1. 5. Designing the User Experience
        1. Introduction
        2. A role-tailored design approach
        3. User experience components
          1. Navigation layer forms
          2. Work layer forms
        4. Role Center pages
          1. Cues
          2. Design Role Centers
        5. Area pages
          1. Design area pages
        6. List pages
          1. A simple scenario: taking a call from a customer
          2. Use a list page as an alternative to a report
          3. Design list pages
        7. Details forms
        8. Transaction details forms
        9. Enterprise Portal web client user experience
          1. Navigation layer forms
          2. Work layer forms
          3. Design for Enterprise Portal
        10. Design for your users
      2. 6. The Microsoft Dynamics AX Client
        1. Introduction
        2. Working with forms
          1. Form patterns
          2. Form metadata
            1. Metadata associations
            2. Metadata inheritance
          3. Form data sources
            1. Dynalinks
            2. Table inheritance
            3. Unit of Work
            4. Date effectivity
            5. Surrogate foreign keys
            6. Metadata for form data sources
          4. Form queries
            1. QueryBuildDataSource and QueryRunQueryBuildDataSource methods
            2. Query and QueryRun objects
            3. CopyCallerQuery property
            4. Query filters
        3. Adding controls
          1. Control overrides
          2. Control data binding
          3. Design node properties
          4. Runtime modifications
          5. Action controls
            1. Buttons
            2. Action pane and Action pane strip
          6. Layout controls
            1. Group
            2. TabPage
            3. Grid
          7. Input controls
            1. Field-bound controls
            2. Method-bound controls
            3. Unbound controls
          8. ManagedHost control
          9. Other controls
        4. Using parts
          1. Types of parts
          2. Reference a part from a form
        5. Adding navigation items
          1. MenuItem
          2. Menu
          3. Menu definitions
        6. Customizing forms with code
          1. Method overrides
          2. Auto variables
          3. Business logic
          4. Custom lookups
        7. Integrating with the Microsoft Office client
          1. Make data sources available to Office Add-ins
            1. Make a service available
            2. Make a query available
          2. Build an Excel template
          3. Build a Word template
          4. Add templates for users
      3. 7. Enterprise Portal
        1. Introduction
        2. Enterprise Portal architecture
        3. Enterprise Portal components
          1. Web parts
          2. AOT elements
          3. Datasets
          4. Enterprise Portal framework controls
            1. AxDataSource
            2. AxForm
            3. AxMultiSection
            4. AxSection
            5. AxMultiColumn
            6. AxColumn
            7. AxGroup
            8. AxGridView
            9. AxHierarchicalGridView
            10. AxContextMenu
            11. AxFilter
            12. AxLookup
            13. AxActionPane
            14. AxToolbar
            15. AxPopup controls
            16. BoundField controls
            17. AxContentPanel
            18. AxPartContentArea
            19. AxInfoPart
            20. AxFormPart
            21. CueGroupPartControl
            22. AxDatePicker
            23. AxReportViewer
        4. Developing for Enterprise Portal
          1. Create a model-driven list page
            1. Define a list page interaction class
          2. Create a details page
            1. Modal dialog settings
          3. AJAX
          4. Session disposal and caching
          5. Context
          6. Data
          7. Metadata
          8. Proxy classes
          9. ViewState
          10. Labels
          11. Formatting
          12. Validation
          13. Error handling
        5. Security
          1. Secure web elements
          2. Record context and encryption
        6. SharePoint integration
          1. Site navigation
          2. Site definitions, page templates, and web parts
          3. Import and deploy a web part page
          4. Enterprise Search
          5. Themes
      4. 8. Workflow in Microsoft Dynamics AX
        1. Introduction
        2. Microsoft Dynamics AX 2012 workflow infrastructure
        3. Windows Workflow Foundation
        4. Key workflow concepts
          1. Workflow document and workflow document class
          2. Workflow categories
          3. Workflow types
          4. Event handlers
          5. Menu items
          6. Workflow elements
          7. Queues
          8. Providers
          9. Workflows
          10. Workflow instances
          11. Work items
        5. Workflow architecture
          1. Workflow runtime
          2. Workflow runtime interaction
          3. Logical approval and task workflows
        6. Workflow life cycle
        7. Implementing workflows
          1. Create workflow artifacts, dependent artifacts, and business logic
          2. State management
          3. Create a workflow category
          4. Create the workflow document class
          5. Add a workflow display menu item
          6. Activate the workflow
      5. 9. Reporting in Microsoft Dynamics AX
        1. Introduction
        2. Inside the Microsoft Dynamics AX 2012 reporting framework
          1. Client-side reporting solutions
          2. Server-side reporting solutions
          3. Report execution sequence
        3. Plan your reporting solution
          1. Reporting and users
          2. Roles in report development
        4. Create production reports
          1. Model elements for reports
            1. Controls
            2. Designs
            3. Datasets
          2. SSRS extensions
          3. Microsoft Dynamics AX extensions
            1. Disable the rendering extensions
            2. Data processing extensions
            3. Report execution sequence with Microsoft Dynamics AX custom extensions
        5. Create charts for Enterprise Portal
          1. Microsoft Dynamics AX chart development tools
          2. Integration with Microsoft Dynamics AX
            1. Create an EP Chart Control
            2. Chart control markup elements
            3. Bind the chart control to the dataset
          3. Data series
            1. Single series datasets
            2. Multiseries datasets
            3. Dynamic series datasets
          4. Add interactive functions to a chart
          5. Override the default chart format
        6. Troubleshoot the reporting framework
          1. The report server cannot be validated
          2. A report cannot be generated
          3. A chart cannot be debugged because of SharePoint sandbox issues
      6. 10. BI and Analytics
        1. Introduction
        2. Components of the Microsoft Dynamics AX 2012 BI solution
        3. Implementing the prebuilt BI solution
          1. Implement the prerequisites
          2. Configure an SSAS server
          3. Deploy cubes
          4. Deploy cubes in an environment with multiple partitions
          5. Process cubes
          6. Provision users in Microsoft Dynamics AX
            1. Associate a user with a profile
            2. Provide access to the OLAP database
        4. Customizing the prebuilt BI solution
          1. Configure analytic content
          2. Customize cubes
            1. Choose the project to update
            2. Select metadata
            3. Select financial dimensions
            4. Select calendars
            5. Select languages
            6. Add support for currency conversion
            7. Confirm your changes
            8. Save the updated project
            9. Deploy and process cubes
          3. Extend cubes
            1. DSV
            2. Data source
            3. Dimensions, measures, and measure groups
            4. KPIs and calculations
            5. Integrate Microsoft Dynamics AX analytic components with external data sources
        5. Creating cubes
          1. Identify requirements
          2. Define metadata
            1. Define perspectives
            2. Define table-level properties
            3. Define field-level properties
          3. Generate and deploy the cube
            1. Define the project
            2. Add currency conversion logic
            3. Save the project
            4. Deploy and process the project
          4. Add KPIs and calculations
        6. Displaying analytic content in Role Centers
          1. Provide insights tailored to a persona
          2. Choose a presentation tool based on a persona
          3. SQL Server Power View reports
            1. Expose a Power View report in a Role Center
            2. Allow users to edit a Power View report
          4. Excel
          5. Business Overview web part and KPI List web part
            1. Add a KPI to the KPI List web part
            2. Add a custom time period filter
            3. Period template: CurrentDate
            4. Indicator: Month_LastMonth
          6. Develop reports with Report Builder
          7. Develop analytic reports by using Visual Studio tools for Microsoft Dynamics AX
      7. 11. Security, Licensing, and Configuration
        1. Introduction
        2. Security framework overview
          1. Authentication
          2. Authorization
            1. Permissions
            2. Privileges
            3. Duties
            4. Process cycles
            5. Security roles
          3. Data security
        3. Develop security artifacts
          1. Set permissions for a form
          2. Set permissions for server methods
          3. Set permissions for controls
          4. Create privileges
          5. Assign privileges and duties to security roles
          6. Use valid time state tables
        4. Validate security artifacts
          1. Create users
          2. Assign users to roles
          3. Set up segregation of duties rules
        5. Create extensible data security policies
          1. Data security policy concepts
          2. Develop an extensible data security policy
          3. Debug extensible data security policies
        6. Security coding
          1. Table permissions framework
          2. Code access security
          3. Best practice rules
          4. Security debugging
            1. Debug security roles
        7. Licensing and configuration
          1. Configuration hierarchy
          2. Configuration keys
          3. Use configuration keys
          4. Types of CALs
          5. Customization and licensing
            1. Changing menu items associated with a role
            2. Changing security artifacts associated with a role
      8. 12. Microsoft Dynamics AX Services and Integration
        1. Introduction
        2. Types of Microsoft Dynamics AX services
          1. System services
          2. Custom services
            1. Custom service artifacts
            2. Service implementation class
            3. Service contracts
            4. Data contracts
            5. X++ collections as data contracts
            6. Register a custom service
          3. Document services
            1. Document service artifacts
            2. Axd<Document> classes
            3. Ax<Table> classes
            4. Create document services
            5. Customize document services
          4. Security considerations
          5. Publish Microsoft Dynamics AX services
        3. Consume Microsoft Dynamics AX services
          1. Sample WCF client for CustCustomerService
          2. Consume system services
          3. Update business documents
            1. Apply a full update
            2. Apply a partial update
            3. Optimistic concurrency control
          4. Invoke custom services asynchronously
        4. The Microsoft Dynamics AX send framework
          1. Implementing a trigger for transmission
            1. AIF Send API
            2. AxdSend API
          2. Configure transmission mechanisms
        5. Consume external web services from Microsoft Dynamics AX
        6. Performance considerations
      9. 13. Performance
        1. Introduction
        2. Client/server performance
          1. Reduce round-trips between the client and the server
            1. The cacheAddMethod method
            2. Declarative display method caching
            3. The RunBase technique
            4. Caching and indexing
          2. Write tier-aware code
            1. Handle inMemory temporary tables correctly
            2. Use TempDB temporary tables
            3. Eliminate client callbacks
            4. Group calls into chunks
            5. Pass table buffers by value instead of by reference
        3. Transaction performance
          1. Set-based data manipulation operators
            1. Set-based operations and table hierarchies
            2. The insert_recordset operator
            3. The update_recordset operator
            4. The delete_from operator
            5. The RecordInsertList and RecordSortedList classes
            6. Tips for transferring code into set-based operations
          2. Restartable jobs and optimistic concurrency
          3. Caching
            1. Record caching
            2. The unique index join cache
            3. The EntireTable cache
            4. The RecordViewCache class
            5. SysGlobalObjectCache and SysGlobalCache
          4. Field lists
          5. Field justification
        4. Performance configuration options
          1. SQL Administration form
          2. Server Configuration form
          3. AOS configuration
          4. Client configuration
          5. Client performance
          6. Number sequence caching
          7. Extensive logging
          8. Master scheduling and inventory closing
        5. Coding patterns for performance
          1. Execute X++ code as CIL
          2. Use parallel execution effectively
            1. Batch bundling
            2. Individual task modeling
            3. Top picking
          3. The SysOperation framework
          4. Patterns for checking to see whether a record exists
          5. Run a query only as often as necessary
          6. When to prefer two queries over a join
          7. Indexing tips and tricks
          8. When to use firstfast
          9. Optimize list pages
          10. Aggregate fields to reduce loop iterations
        6. Performance monitoring tools
          1. Microsoft Dynamics AX Trace Parser
            1. New Trace Parser features
            2. Before tracing
            3. Start a trace through the client
            4. Start a trace through Windows Performance Monitor
            5. Start a trace through code instrumentation
            6. Import a trace
            7. Analyze a trace
            8. Troubleshoot tracing
          2. Monitor database activity
          3. Use the SQL Server connection context to find the SPID or user behind a client session
          4. The client access log
          5. Visual Studio Profiler
      10. 14. Extending Microsoft Dynamics AX
        1. Introduction
        2. The SysOperation framework
          1. SysOperation framework classes
          2. SysOperation framework attributes
        3. Comparing the SysOperation and RunBase frameworks
          1. RunBase example: SysOpSampleBasicRunbaseBatch
          2. SysOperation example: SysOpSampleBasicController
        4. The RunBase framework
          1. Inheritance in the RunBase framework
          2. Property method pattern
          3. Pack-unpack pattern
          4. Client/server considerations
        5. The extension framework
          1. Create an extension
          2. Extension example
        6. Eventing
          1. Delegates
          2. Pre and post events
          3. Event handlers
          4. Eventing example
      11. 15. Testing
        1. Introduction
        2. New unit testing features in Microsoft Dynamics AX 2012
          1. Use predefined test attributes
          2. Create test attributes and filters
        3. Microsoft Visual Studio 2010 test tools
          1. Use all aspects of the ALM solution
          2. Use an acceptance test driven development approach
          3. Use shared steps
          4. Record shared steps for fast forwarding
          5. Develop test cases in an evolutionary manner
          6. Use ordered test suites for long scenarios
        4. Putting everything together
          1. Execute tests as part of the build process
          2. Use the right tests for the job
      12. 16. Customizing and Adding Help
        1. Introduction
        2. Help system overview
          1. Microsoft Dynamics AX client
          2. Help viewer
          3. Help server
            1. Help web service
            2. Document files
            3. Windows Search Service (WSS)
          4. AOS
        3. Help content overview
          1. Topics
          2. Publisher
          3. Table of contents
          4. Summary page
        4. Create content
          1. Create a topic in HTML
            1. Declarations
            2. Document head
            3. Document body
            4. Content
            5. Links to related topics
            6. Footer
          2. Add labels, fields, and menu items to a topic
            1. Add a label from the user interface
            2. Add a table field label
            3. Add a menu item label
          3. Make a topic context-sensitive
          4. Update content from other publishers
          5. Create a table of contents file
          6. Create non-HTML content
            1. Create the content
            2. Create the HTML metadata file
        5. Publish content
          1. Add a publisher to the Web.config file
          2. Publish content to the Help server
          3. Set Help document set properties
        6. Troubleshoot the Help system
          1. The Help viewer cannot display content
            1. Help server
            2. WSS
            3. Content
          2. The Help viewer cannot display the table of contents
    7. III. Under the Hood
      1. 17. The Database Layer
        1. Introduction
        2. Temporary tables
          1. InMemory temporary tables
            1. Using InMemory temporary tables
            2. Considerations for working with InMemory temporary tables
          2. TempDB temporary tables
          3. Creating temporary tables
            1. Design time
            2. Configuration time
            3. Run time
        3. Surrogate keys
        4. Alternate keys
        5. Table relations
          1. EDT relations and table relations
          2. Foreign key relations
          3. The CreateNavigationPropertyMethods property
        6. Table inheritance
          1. Modeling table inheritance
            1. Create the root table
            2. Create a derived table
            3. Work with existing tables
            4. View the type hierarchy
            5. Specify table behavior
          2. Table inheritance storage model
          3. Polymorphic behavior
          4. Performance considerations
        7. Unit of Work
        8. Date-effective framework
          1. Relational modeling of date-effective entities
          2. Support for data retrieval
          3. Run-time support for data consistency
            1. Modes for updating records
            2. User experience
        9. Full-text support
        10. The QueryFilter API
        11. Data partitions
          1. Partition management
          2. Development experience
          3. Run-time experience
      2. 18. The Batch Framework
        1. Introduction
        2. Batch processing in Microsoft Dynamics AX 2012
          1. Common uses of the batch framework
          2. Performance
        3. Create and execute a batch job
          1. Create a batch-executable class
            1. run method
            2. pack and unpack methods
            3. canGoBatchJournal method
          2. Create a batch job
            1. Create a batch job from the dialog box of a batch-executable class
            2. Create a batch job by using the Batch Job form
          3. Use the Batch API
            1. Create a batch job by using the BatchHeader class
            2. Modify batch job parameters
            3. Add a task to the batch job
            4. Define dependencies between tasks
            5. Save the batch job
            6. Example of a batch job
        4. Manage batch execution
          1. Configure the batch server
          2. Create a batch group
          3. Manage batch jobs
            1. View and change the batch job status
            2. Control the maximum retries
            3. Review the batch job history
        5. Debug a batch task
          1. Configure AOS for batch debugging
          2. Configure Visual Studio for debugging X++ in a batch
      3. 19. Application Domain Frameworks
        1. Introduction
        2. The organization model framework
          1. How the organization model framework works
            1. Organization types
            2. Organization hierarchies
          2. When to use the organization model framework
            1. Integration with other frameworks application modules
            2. Model your own functional scenarios
            3. Extending the organization model framework
            4. Create a custom operating unit type
            5. Create a custom purpose
            6. Extend the hierarchy designer
        3. The product model framework
          1. How the product model framework works
            1. Product types and subtypes
            2. Product dimensions
            3. Storage and tracking dimensions
            4. Released products
            5. Additional product information
            6. Product attributes and categories
            7. Variant configuration technology
          2. When to use the product model framework
          3. Extending the product model framework
        4. The operations resource framework
          1. How the operations resource framework works
            1. Capabilities
            2. Activities and requirements
            3. Identify applicable resources
          2. When to use the operations resource framework
          3. Extensions to the operations resource framework
            1. Add a new class of activity
            2. Add a new class of activity requirement
          4. MorphX model element prefixes for the operations resource framework
        5. The dimension framework
          1. How the dimension framework works
          2. Constrain combinations of values
          3. Create values
          4. Extend the dimension framework
          5. Query data
          6. Physical table references
        6. The accounting framework
          1. How the accounting framework works
          2. When to use the accounting framework
          3. Extensions to the accounting framework
          4. Accounting framework process states
          5. MorphX model element prefixes for the accounting framework
        7. The source document framework
          1. How the source document framework works
          2. When to use the source document framework
          3. Extensions to the source document framework
          4. MorphX model element prefixes for the source document framework
      4. 20. Reflection
        1. Introduction
        2. Reflection system functions
          1. Intrinsic functions
          2. typeOf system function
          3. classIdGet system function
        3. Reflection APIs
          1. Table data API
          2. Dictionary API
          3. Treenodes API
          4. TreeNodeType
      5. 21. Application Models
        1. Introduction
        2. Layers
        3. Models
        4. Element IDs
        5. Create a model
        6. Prepare a model for publication
          1. Set the model manifest
          2. Export the model
          3. Sign the model
            1. Strong name signing
            2. Authenticode signing
          4. Import model files
            1. Import model files with the overwrite option
            2. Import model files with the push option
        7. Upgrade a model
        8. Move a model from test to production
          1. Create a test environment
          2. Prepare the test environment
          3. Deploy the model to production
          4. Element ID considerations
        9. Model store API
    8. A. Resources for Code Upgrade
    9. B. About the authors
      1. Principal authors
      2. Contributing authors
    10. Index
    11. About the Authors
    12. Copyright