Tải bản đầy đủ (.pdf) (1,421 trang)

Inside microsoft dynamics AX 2012 r3 nodrm

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (30.44 MB, 1,421 trang )


Inside Microsoft Dynamics AX
2012 R3

The Microsoft Dynamics AX Team


PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2014 by Microsoft Corporation
All rights reserved. No part of the contents of this book may be reproduced
or transmitted in any form or by any means without the written permission
of the publisher.
Library of Congress Control Number: 2014940599
ISBN: 978-0-7356-8510-9
Printed and bound in the United States of America.
First Printing
Microsoft Press books are available through booksellers and distributors
worldwide. If you need support related to this book, email Microsoft Press
Book Support at Please tell us what you think
of this book at />Microsoft and the trademarks listed at are trademarks of
the Microsoft group of companies. All other marks are property of their
respective owners.
The example companies, organizations, products, domain names, email
addresses, logos, people, places, and events depicted herein are fictitious.
No association with any real company, organization, product, domain
name, email address, logo, person, place, or event is intended or should be
inferred.


This book expresses the author’s views and opinions. The information
contained in this book is provided without any express, statutory, or
implied warranties. Neither the authors, Microsoft Corporation, nor its
resellers, or distributors will be held liable for any damages caused or
alleged to be caused either directly or indirectly by this book.
Acquisitions Editor: Rosemary Caperton
Developmental Editor: Carol Dillingham
Editorial Production: Online Training Solutions, Inc. (OTSI)
Copyeditors: Kathy Krause and Victoria Thulman (OTSI)


Indexer: Susie Carr (OTSI)
Cover: Twist Creative • Seattle and Joel Panchot


Contents
Foreword
Introduction
PART I A TOUR OF THE DEVELOPMENT ENVIRONMENT
Chapter 1 Architectural overview
Introduction
AX 2012 five-layer solution architecture
AX 2012 application platform architecture
Application development environments
Data tier
Middle tier
Presentation tier
AX 2012 application meta-model architecture
Application data element types
MorphX user interface control element types

Workflow element types
Code element types
Services element types
Role-based security element types
Web client element types
Documentation and resource element types
License and configuration element types
Chapter 2 The MorphX development environment and tools
Introduction
Application Object Tree
Navigating through the AOT
Creating elements in the AOT
Modifying elements in the AOT
Refreshing elements in the AOT


Element actions in the AOT
Element layers and models in the AOT
Projects
Creating a project
Automatically generating a project
Project types
The property sheet
X++ code editor
Shortcut keys
Editor scripts
Label editor
Creating a label
Referencing labels from X++
Compiler

Best Practices tool
Rules
Suppressing errors and warnings
Adding custom rules
Debugger
Enabling debugging
Debugger user interface
Debugger shortcut keys
Reverse Engineering tool
UML data model
UML object model
Entity relationship data model
Table Browser tool
Find tool
Compare tool
Starting the Compare tool
Using the Compare tool
Compare APIs


Cross-Reference tool
Version control
Element life cycle
Common version control tasks
Working with labels
Synchronizing elements
Viewing the synchronization log
Showing the history of an element
Comparing revisions
Viewing pending elements

Creating a build
Integrating AX 2012 with other version control systems
Chapter 3 AX 2012 and .NET
Introduction
Integrating AX 2012 with other systems
Using third-party assemblies
Writing managed code
Hot swapping assemblies on the server
Using LINQ with AX 2012 R3
The var keyword
Extension methods
Anonymous types
Lambda expressions
Walkthrough: Constructing a LINQ query
Using queries to read data
AX 2012 R3–specific extension methods
Updating, deleting, and inserting records
Limitations
Advanced: limiting overhead
Chapter 4 The X++ programming language
Introduction
Jobs


The type system
Value types
Reference types
Type hierarchies
Syntax
Variable declarations

Expressions
Statements
Macros
Comments
XML documentation
Classes and interfaces
Fields
Methods
Delegates
Pre-event and post-event handlers
Attributes
Code access security
Compiling and running X++ as .NET CIL
Design and implementation patterns
Class-level patterns
Table-level patterns
PART II DEVELOPING FOR AX 2012
Chapter 5 Designing the user experience
Introduction
Role-tailored design approach
User experience components
Navigation layer forms
Work layer forms
Role Center pages
Cues


Designing Role Centers
Area pages
Designing area pages

List pages
Scenario: taking a call from a customer
Using list pages as an alternative to reports
Designing list pages
Details forms
Transaction details forms
Enterprise Portal web client user experience
Navigation layer forms
Work layer forms
Designing for Enterprise Portal
Designing for your users
Chapter 6 The AX 2012 client
Introduction
Working with forms
Form patterns
Form metadata
Form data sources
Form queries
Adding controls
Control overrides
Control data binding
Design node properties
Run-time modifications
Action controls
Layout controls
Input controls
ManagedHost control
Other controls
Using parts



Types of parts
Referencing a part from a form
Adding navigation items
MenuItem
Menu
Menu definitions
Customizing forms with code
Method overrides
Auto variables
Business logic
Custom lookups
Integrating with the Microsoft Office client
Make data sources available to Office Add-ins
Build an Excel template
Build a Word template
Add templates for users
Chapter 7 Enterprise Portal
Introduction
Enterprise Portal architecture
Enterprise Portal components
Web parts
AOT elements
Datasets
Enterprise Portal framework controls
Developing for Enterprise Portal
Creating a model-driven list page
Creating a details page
AJAX
Session disposal and caching

Context
Data
Metadata


Proxy classes
ViewState
Labels
Formatting
Validation
Error handling
Security
Secure web elements
Record context and encryption
SharePoint integration
Site navigation
Site definitions, page templates, and web parts
Importing and deploying a web part page
Enterprise Search
Themes
Chapter 8 Workflow in AX 2012
Introduction
AX 2012 workflow infrastructure
Windows Workflow Foundation
Key workflow concepts
Workflow document and workflow document class
Workflow categories
Workflow types
Event handlers
Menu items

Workflow elements
Queues
Providers
Workflows
Workflow instances
Work items
Workflow architecture


Workflow runtime
Workflow runtime interaction
Logical approval and task workflows
Workflow life cycle
Implementing workflows
Creating workflow artifacts, dependent artifacts, and business
logic
Managing state
Creating a workflow category
Creating the workflow document class
Adding a workflow display menu item
Activating the workflow
Chapter 9 Reporting in AX 2012
Introduction
Inside the AX 2012 reporting framework
Client-side reporting solutions
Server-side reporting solutions
Report execution sequence
Planning your reporting solution
Reporting and users
Roles in report development

Creating production reports
Model elements for reports
SSRS extensions
AX 2012 extensions
Creating charts for Enterprise Portal
AX 2012 chart development tools
Integration with AX 2012
Data series
Adding interactive functions to a chart
Overriding the default chart format
Troubleshooting the reporting framework


The report server cannot be validated
A report cannot be generated
A chart cannot be debugged because of SharePoint sandbox
issues
A report times out
Chapter 10 BI and analytics
Introduction
Components of the AX 2012 BI solution
Implementing the AX 2012 BI solution
Implementing the prerequisites
Configuring an SSAS server
Deploying cubes
Deploying cubes in an environment with multiple partitions
Processing cubes
Provisioning users
Customizing the AX 2012 BI solution
Configuring analytic content

Customizing cubes
Extending cubes
Integrating AX 2012 analytic components with external data
sources
Maintaining customized and extended projects in the AOT
Creating cubes
Identifying requirements
Defining metadata
Generating and deploying the cube
Adding KPIs and calculations
Displaying analytic content in Role Centers
Providing insights tailored to a persona
Choosing a presentation tool based on a persona
SQL Server Power View
Power BI for Office 365


Comparing Power View and Power BI
Authoring with Excel
Business Overview web part and KPI List web part
Developing reports with Report Builder
Developing reports with the Visual Studio tools for AX 2012
Chapter 11 Security, licensing, and configuration
Introduction
Security framework overview
Authentication
Authorization
Data security
Developing security artifacts
Setting permissions for a form

Setting permissions for server methods
Setting permissions for controls
Creating privileges
Assigning privileges and duties to security roles
Using valid time state tables
Validating security artifacts
Creating users
Assigning users to roles
Setting up segregation of duties rules
Creating extensible data security policies
Data security policy concepts
Developing an extensible data security policy
Debugging extensible data security policies
Security coding
Table permissions framework
Code access security framework
Best practice rules
Security debugging
Licensing and configuration


Configuration hierarchy
Configuration keys
Using configuration keys
Types of CALs
Customization and licensing
Chapter 12 AX 2012 services and integration
Introduction
Types of AX 2012 services
System services

Custom services
Document services
Security considerations
Publishing AX 2012 services
Consuming AX 2012 services
Sample WCF client for CustCustomerService
Consuming system services
Updating business documents
Invoking custom services asynchronously
The AX 2012 send framework
Implementing a trigger for transmission
Consuming external web services from AX 2012
Performance considerations
Chapter 13 Performance
Introduction
Client/server performance
Reducing round trips between the client and the server
Writing tier-aware code
Transaction performance
Set-based data manipulation operators
Restartable jobs and optimistic concurrency
Caching
Field lists


Field justification
Performance configuration options
SQL Administration form
Server Configuration form
AOS configuration

Client configuration
Client performance
Number sequence caching
Extensive logging
Master scheduling and inventory closing
Coding patterns for performance
Executing X++ code as common intermediate language
Using parallel execution effectively
The SysOperation framework
Patterns for checking to see whether a record exists
Running a query only as often as necessary
When to prefer two queries over a join
Indexing tips and tricks
When to use firstfast
Optimizing list pages
Aggregating fields to reduce loop iterations
Performance monitoring tools
Microsoft Dynamics AX Trace Parser
Monitoring database activity
Using the SQL Server connection context to find the SPID or
user behind a client session
The client access log
Visual Studio Profiler
Chapter 14 Extending AX 2012
Introduction
The SysOperation framework
SysOperation framework classes


SysOperation framework attributes

Comparing the SysOperation and RunBase frameworks
RunBase example: SysOpSampleBasicRunbaseBatch
SysOperation example: SysOpSampleBasicController
The RunBase framework
Inheritance in the RunBase framework
Property method pattern
Pack-unpack pattern
Client/server considerations
The extension framework
Create an extension
Add metadata
Extension example
Eventing
Delegates
Pre and post events
Event handlers
Eventing example
Chapter 15 Testing
Introduction
Unit testing features in AX 2012
Using predefined test attributes
Creating test attributes and filters
Microsoft Visual Studio 2010 test tools
Using all aspects of the ALM solution
Using an acceptance test driven development approach
Using shared steps
Recording shared steps for fast forwarding
Developing test cases in an evolutionary manner
Using ordered test suites for long scenarios
Putting everything together

Executing tests as part of the build process


Using the right tests for the job
Chapter 16 Customizing and adding Help
Introduction
Help system overview
AX 2012 client
Help viewer
Help server
AOS
Help content overview
Topics
Publisher
Table of contents
Summary page
Creating content
Walkthrough: create a topic in HTML
Adding labels, fields, and menu items to a topic
Make a topic context-sensitive
Update content from other publishers
Create a table of contents file
Creating non-HTML content
Publishing content
Add a publisher to the Web.config file
Publish content to the Help server
Set Help document set properties
Troubleshooting the Help system
The Help viewer cannot display content
The Help viewer cannot display the table of contents

PART III UNDER THE HOOD
Chapter 17 The database layer
Introduction
Temporary tables


InMemory temporary tables
TempDB temporary tables
Creating temporary tables
Surrogate keys
Alternate keys
Table relations
EDT relations and table relations
Foreign key relations
The CreateNavigationPropertyMethods property
Table inheritance
Modeling table inheritance
Table inheritance storage model
Polymorphic behavior
Performance considerations
Unit of Work
Date-effective framework
Relational modeling of date-effective entities
Support for data retrieval
Run-time support for data consistency
Full-text support
The QueryFilter API
Data partitions
Partition management
Development experience

Run-time experience
Chapter 18 Automating tasks and document distribution
Introduction
Batch processing in AX 2012
Common uses of the batch framework
Performance
Creating and executing a batch job
Creating a batch-executable class


Creating a batch job
Configuring the batch server and creating a batch group
Managing batch jobs
Debugging a batch task
Print management in AX 2012
Common uses of print management
The print management hierarchy
Print management settings
Chapter 19 Application domain frameworks
Introduction
The organization model framework
How the organization model framework works
When to use the organization model framework
Extending the organization model framework
The product model framework
How the product model framework works
When to use the product model framework
Extending the product model framework
The operations resource framework
How the operations resource framework works

When to use the operations resource framework
Extending the operations resource framework
MorphX model element prefixes for the operations resource
framework
The dimension framework
How the dimension framework works
Constraining combinations of values
Creating values
Extending the dimension framework
Querying data
Physical table references
The accounting framework


How the accounting framework works
When to use the accounting framework
Extensions to the accounting framework
Accounting framework process states
MorphX model element prefixes for the accounting
framework
The source document framework
How the source document framework works
When to use the source document framework
Extensions to the source document framework
MorphX model element prefixes for the source document
framework
Chapter 20 Reflection
Introduction
Reflection system functions
Intrinsic functions

typeOf system function
classIdGet system function
Reflection APIs
Table data API
Dictionary API
Treenodes API
TreeNodeType
Chapter 21 Application models
Introduction
Layers
Models
Element IDs
Creating a model
Preparing a model for publication
Setting the model manifest
Exporting the model


Signing the model
Importing model files
Upgrading a model
Moving a model from test to production
Creating a test environment
Preparing the test environment
Deploying the model to production
Element ID considerations
Model store API
PART IV BEYOND AX 2012
Chapter 22 Developing mobile apps for AX 2012
Introduction

The mobile app landscape and AX 2012
Mobile architecture
Mobile architecture components
Message flow and authentication
Using AX 2012 services for mobile clients
Developing an on-premises listener
Developing a mobile app
Platform options and considerations
Developer documentation and tools
Third-party libraries
Best practices
Key aspects of authentication
User experience
Globalization and localization
App monitoring
Web traffic debugging
Architectural variations
On-corpnet apps
Web apps


Resources
Chapter 23 Managing the application life cycle
Introduction
Lifecycle Services
Deploying customizations
Data import and export
Test Data Transfer Tool
Data Import/Export Framework
Choosing between the Test Data Transfer Tool and DIXF

Benchmarking
Index
About the authors
What do you think of this book? We want to hear from you!
Microsoft is interested in hearing your feedback so we can continually improve our
books and learning resources for you. To participate in a brief online survey, please visit:

microsoft.com/learning/booksurvey


Foreword
The release of Microsoft Dynamics AX 2012 R3 and this book coincide
with the tenth anniversary of my involvement with the development of this
product. I’ve had the pleasure to work with a great team of people
throughout that period. When I reflect on the modest ambition we set out
with a decade ago, I’m excited to see all that we have achieved and am
grateful for all the support we received along the way from our customers,
partners, and the community around this product.
We set out to build a next-generation line-of-business system that
empowered people. We wanted to go beyond traditional ERP in multiple
ways:
First and foremost was to create a system of empowerment, not a
system of records. Microsoft Dynamics AX is designed to help
people do their jobs, not to record what they did after they did it.
Second, we wanted to maintain an agile system that allowed
businesses to change at their own pace and not at the pace of
previous generations of electronic concrete.
Third, we wanted to provide functional depth and richness while
maintaining simplicity of implementation, to allow both midsize and
large organizations to use the same system.

The embodiment of our first goal is role-tailored computing and
pervasive BI. Those new to the Microsoft Dynamics AX community after
AX 2009 can’t imagine a day when that wasn’t a standard part of the
product. AX 2012 takes that richness to a whole new level with more than
80 predefined security roles, and Role Centers for more than 40 distinct
functions in an organization.
The implementation of our second goal is in the richness of the AX
2012 metadata system and tools, combined with the fact that all of our
solutions and localizations are designed to work together. AX 2012
enhances those capabilities even further while adding the organizational
model, self-balancing dimensions, date effectivity, and other powerful
application foundation elements.
The realization of the third goal came in the form of deep industry
solutions for manufacturing, distribution, retail, service industries, and the
public sector, along with a comprehensive set of life cycle services for
design, development, deployment, and operations.


This book focuses on the enhancements to the Microsoft Dynamics AX
developer toolset and is written by the team that brought you those tools.
It’s truly an insider’s view of the entire AX 2012 development and runtime
environment (now updated for the AX 2012 R3 release). I hope you enjoy
it as much as we enjoyed writing the book and creating the product.
Here’s to the next ten years of our journey together.
Thanks,
Hal Howard
Head of Product Development, Microsoft Dynamics AX
Corporate Vice President, Microsoft Dynamics Research and
Development



×