1075 Inside Microsoft Dynamics AX 2012

Inside Microsoft

  

®

Dynamics AX 2012 The Microsoft Dynamics AX Team PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2012 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: 2012950241

  ISBN: 978-0-7356-6710-5 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 mspinput@microsoft.com. Please tell us what you think of this book at http://www.microsoft.com/learning/booksurvey.

  

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: Anne Hamilton Developmental Editor: Margaret Sherman with the Microsoft Dynamics AX Team Project Editor: Valerie Woolley Editorial Production: Christian Holdener, S4Carlisle Publishing Services Technical Reviewer: Allan Iversen Copyeditor: Andrew Jones Indexer: Maureen Johnson, MoJo’s Indexing Service Cover: Twist Creative ∙ Seattle

Contents at a glance

  Foreword xxiii

   xxv

  PART I A TOUR OF THE DEVELOPMENT ENVIRONMENT CHAPTER 1 Architectural overview

  3 CHAPTER 2 The MorphX development environment and tools

  19 CHAPTER 3 Microsoft Dynamics AX and .NET

  73 CHAPTER 4 The X++ programming language

  87 PART II DEVELOPING WITH MICROSOFT DYNAMICS AX

  Michael Merz is a program manager for Microsoft Dynamics AX, where he is

  responsible for the delivery of the Microsoft Dynamics AX services framework and Microsoft Dynamics AX integration capabilities. He has over 15 years of experience in the software industry. Prior to working at Microsoft, Michael held various engineering and management positions in companies including Amazon. com, BEA Systems, and early-stage start-up companies, where he worked on embedded systems, online advertising, social networks, and enterprise software. He has an MSc in computer science from Ulm University, Germany, and lives in Bothell, WA, with his wife, Florina, and his children, Brooke and Joshua.

  Amar Nalla is currently a development lead in the Microsoft Dynamics AX product group. He has more than 11 years of experience in the software industry.

  He started working on the Microsoft Dynamics team during the Axapta 4.0 release. He is part of the foundation team responsible for the Microsoft Dynamics AX server components, and during the past three releases of Microsoft

  Dynamics AX, he has worked on various components of the server. He maintains a blog at http://blogs.msdn.com/b/amarnalla/.

  In his spare time, Amar likes to explore the beautiful Puget Sound area.

  Parth Pandya is a senior program manager in the Microsoft Dynamics AX

  product group. For Microsoft Dynamics AX 2012, Parth’s area of focus was the new security framework that was built for the release, including the flexible authentication capability and support for Active Directory groups as Microsoft Dynamics AX users. He also contributed to the named user licensing model that was instituted for Microsoft Dynamics AX 2012. Parth has been with Microsoft for over nine years, over five of which were spent working on various releases of the Windows Internet Explorer browser. He particularly enjoyed working as a penetration tester for the number one target of hackers around the world.

  Parth swapped the organized chaos of Mumbai, India, for the disorienting tranquility of the Pacific Northwest, where he lives with his wife, Varsha, and three-year-old son, Aarush.

  Gustavo Plancarte is a senior software design engineer who joined Microsoft

  in 2004 after graduating from ITESM in Monterrey, Mexico. He has worked on Microsoft Dynamics AX since version 4.0. On the platform team, he is responsible for driving the common intermediate language (CIL) migration of the X++ programming language, the Software-plus-Services architecture of

Contents

Foreword xxiii Introduction xxv

  

  

PART I A TOUR OF THE DEVELOPMENT ENVIRONMENT Chapter 1 Architectural overview

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  PART II DEVELOPING WITH MICROSOFT DYNAMICS AX

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  PART III UNDER THE HOOD

   Data partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .610

  

  

  

  

  

  

  

  

  

  

  

  

  

  7

Foreword

  icrosoft Dynamics AX and its predecessor, Axapta, have always benefited from a very active and enthusiastic developer community. Some of those developers

  M

  are employed by mid-size to large firms that build their business selling solutions built on Microsoft Dynamics AX. Others are in the IT departments of companies using Microsoft Dynamics AX as mission-critical infrastructure.

  One of the consistent pieces of feedback I’ve received from those developers over the years is how the raw power and agility provided by the Microsoft Dynamics AX toolset and metadata environment make them more productive than any other line of business application framework. With Microsoft Dynamics AX 2012, we have taken the productivity and power of that toolset to a whole new level; delivering event-based customization, delta customization of forms, a new editor, date effectivity, and subtype/ supertype support, to name just a few.

  We continued the journey to expose the power of Microsoft SQL Server Reporting Services (SSRS) and Analysis Services directly within Microsoft Dynamics AX, moving all of the out-of-the-box reports and business intelligence inside the platform.

  We back all of that up with almost three times the application footprint of prior versions of Microsoft Dynamics AX, truly making Microsoft Dynamics AX both a powerful developer environment and a rich out-of-the-box suite of applications.

  This book focuses on the enhancements in the Microsoft Dynamics AX 2012 toolset and is written by the team that brought you those tools. It’s truly an insider’s view of the entire Microsoft Dynamics AX development and run-time environment. I hope you enjoy it as much as we enjoyed writing the book and creating the product.

  Thanks, Hal Howard

  Head of Product Development, Microsoft Dynamics AX Corporate Vice President, Microsoft Dynamics Research and Development

Introduction

  icrosoft Dynamics AX 2012 represents a new generation of enterprise resource planning (ERP) software. With over 1,000 new features and prebuilt industry

  M

  capabilities for manufacturing, distribution, services, retail, and public sector, Microsoft Dynamics AX 2012 provides a robust platform for developers to deliver specialized functionality more efficiently to the industries that they support.

  Microsoft Dynamics AX 2012 is a truly global solution, able to scale with any business as it grows. It is simple enough to deploy for a single business unit in a single country/region, yet robust enough to support the unique requirements for business systems in 36 countries/regions—all from a single-instance deployment of the software.

  For this version of Microsoft Dynamics AX, the entire codebase was analyzed and, where necessary, reengineered, so that the application is built more holistically around a set of unified principles. As Microsoft Technical Fellow Mike Ehrenberg explains:

  The heart of Microsoft Dynamics AX 2012 is a set of unified, natural models that let you see, measure, and change your business. In developing this release, every application concept involved in representing the business in software was reexamined. In each case, limitations that forced workarounds and compromises in older ERP products were lifted, and new capabilities were added to provide an even richer software representation of a business and its structure, processes, and policies. Unified, natural Microsoft Dynamics AX 2012 models make modeling simple businesses fast and easy and yet still provide the richness and flexibility to represent the most complex organizations.

Early adopters have also weighed in on the benefits of Microsoft Dynamics AX 2012:

  Microsoft Dynamics AX 2012 allows us to collaborate within our organization and with our constituents . . . using built-in controls and fund/encumbrance accounting capabilities to ensure compliance with Public Sector requirements . . . and using out-of the-box Business Analytics and Intelligence . . . so executives can make effective decisions in real time.

  Mike Bailey Director of Finance and Information Services City of Redmond (WA)

  With the latest release, developing for and customizing Microsoft Dynamics AX will be easier than ever. Developers will be able to work with X++ directly from within Microsoft Visual Studio and enjoy more sophisticated features in the X++ editor, for example. Also, the release includes more prebuilt interoperability with Microsoft SharePoint Server and SQL Server Reporting Services, so that developers spend less time on mundane work when setting up customer systems. Guido Van de Velde Director of MECOMS™ Ferranti Computer Systems

  Microsoft Dynamics AX 2012 is substantially different from its predecessor, which can mean a steep learning curve for developers and system implementers who have worked with previous versions. However, by providing a broad overview of the architectural changes, new technologies, and tools for this release, the authors of Inside Microsoft

  Dynamics AX 2012 have created a resource that will help reduce the time that it takes for developers to become productive with this version of Microsoft Dynamics AX.

The history of Microsoft Dynamics AX

  Historically, Microsoft Dynamics AX encompasses more than 25 years of experience in business application innovation and developer productivity. Microsoft acquired the predecessor of Microsoft Dynamics AX, called Axapta, in 2002, with its purchase of the Danish company Navision A/S. The success of the product has spurred an increasing commitment of research and development resources, which allows Microsoft Dynamics AX to grow and strengthen its offering continuously.

  The development team that created Microsoft Dynamics AX 2012 consists of three large teams, two that are based in the United States (Fargo, North Dakota, and

Redmond, Washington) and one that is based in Denmark (Copenhagen). The Fargo team focuses on finance and human resources (HR), the Redmond team concentrates

  on project management and accounting and customer relationship management (CRM), and the Copenhagen team delivers supply chain management (SCM). In addition, a framework team develops infrastructure components, and a worldwide distributed team localizes the Microsoft Dynamics AX features to meet national regulations or local differences in business practices in numerous languages and markets around the world. To clarify a few aspects of the origins of Microsoft Dynamics AX, the authors contacted people who participated in the early stages of the Microsoft Dynamics AX development cycle. The first question we asked was, “How was the idea of using X++ as the programming language for Microsoft Dynamics AX conceived?”

  We had been working with an upgraded version of XAL for a while called OO

  XAL back in 1996/1997. At some point in time, we stopped and reviewed our approach and looked at other new languages like Java. After working one long night, I decided that our approach had to change to align with the latest trends in programming languages, and we started with X++.

  Erik Damgaard Cofounder of Damgaard Data Of course, the developers had several perspectives on this breakthrough event.

  One morning when we came to work, nothing was working. Later in the morning, we realized that we had changed programming languages! But we did not have any tools, so for months we were programming in Notepad without compiler or editor support.

  Anonymous developer Many hypotheses exist regarding the origin of the original product name, Axapta. Axapta was a constructed name, and the only requirement was that the letter X be included, to mark the association with its predecessor, XAL. The X association carries over in the name Microsoft Dynamics AX.

Who should read this book

  This book explores the technology and development tools in Microsoft Dynamics AX 2012. It is designed to help new and existing Microsoft Dynamics AX developers by providing holistic and in-depth information about developing for Microsoft Dynamics AX 2012—information that may not be available from other resources, such as SDK documentation, blogs, or forums. It aids developers who are either customizing Microsoft Dynamics AX 2012 for a specific implementation or building modules or applications that blend seamlessly with Microsoft Dynamics AX 2012. System implementers and consultants will also find much of the information useful.

Assumptions

  To get full value from this book, you should have knowledge of common object-oriented concepts from languages such as C++, C#, and Java. You should also have knowledge of relational database concepts. Knowledge of Structured Query Language (SQL) and Microsoft .NET technology are also advantageous. Transact-SQL statements are used to perform relational database tasks, such as data updates and data retrieval.

Who should not read this book

  This book is not aimed at those who install, upgrade, or deploy Microsoft Dynamics AX 2012. It is also beyond the scope of this book to include details about the sizing of production environments. For more information about these topics, refer to the extensive installation and implementation documentation that is supplied with the product or available on TechNet, MSDN, and other websites.

  The book also does not provide instructions for those who configure parameter options within Microsoft Dynamics AX 2012 or the business users who use the application in their day-to-day work. For assistance with these activities, refer to the

  

Organization of this book

  Although Inside Microsoft Dynamics AX 2012 does not provide exhaustive coverage of every feature in Microsoft Dynamics AX 2012, it does offer a broad view that will benefit developers as they develop for the product.

  This book is divided into three sections, each of which focuses on Microsoft Dynamics AX 2012 from a different angle. Part I, “A tour of the development environment,” provides an overview of the Microsoft Dynamics AX 2012 architecture that has been written with developers in mind. The chapters in Part I also provide a tour of the internal Microsoft Dynamics AX 2012 development environment to help new developers familiarize themselves with the designers and tools that they will use to implement their customizations, extensions, and integrations.

  Part II, “Developing with Microsoft Dynamics AX 2012,” provides the information that developers need in order to customize and extend Microsoft Dynamics AX 2012. In addition to explanations of the features, many chapters include examples, some of which are available as downloadable files that can help you learn how to code for Microsoft Dynamics AX. For information about how to access these files, see the “Code samples” section, later in this introduction.

  Part III, “Under the hood,” is largely devoted to illustrating how developers can use the underlying foundation of the Microsoft Dynamics AX 2012 application frameworks to develop their solutions, with a focus on the database layer, system and application frameworks, reflection, and models.

Conventions and features in this book

  This book presents information using the following conventions, which are designed to make the information readable and easy to follow.

  ■

  Application Object Tree (AOT) paths use backslashes to separate nodes, such as Forms\AccountingDistribution\Methods.

  ■

  The names of methods, functions, properties and property values, fields, and nodes appear in italics.

  ■ Registry keys and T-SQL commands appear in capital letters. ■

  User interface (UI) paths use angle brackets to indicate actions—for example, “On the File menu, point to Tools > Options.”

  ■

  Boxed elements with labels such as “Note” provide additional information or alternative methods for completing a step successfully.

  ■ Text that you type (apart from code blocks) appears in bold. ■

  A plus sign (+) between two key names means that you must press those keys at the same time. For example, “Press Alt+Tab” means that you hold down the Alt key while you press the Tab key.

System requirements

  To work with sample code, you must have the RTM version of Microsoft Dynamics AX 2012 installed. For information about the system requirements for installing Microsoft Dynamics AX 2012, see the Microsoft Dynamics AX 2012 Installation Guide at http://www.microsoft.com/en-us/download/details.aspx?id=12687.

  You must also have an Internet connection to download the sample files that are provided as supplements to many of the chapters.

  Note Some of the features described in this book, such as data partitioning and the EP Chart Control, apply only to the Microsoft Dynamics AX 2012 R2.

  That is noted where those features are discussed.

Code samples

  Most of the chapters in this book include code examples that let you interactively try out the new material presented in the main text. You can download the example code from the following page:

  http://go.microsoft.com/FWLink/?Linkid=263524

  Follow the instructions to download the InsideDynaAX2012_667105_ CompanionContent.zip file.

Installing the code samples

  Follow these steps to install the code samples on your computer: 1.

  Unzip the InsideDynaAX2012_667105_CompanionContent.zip file that you downloaded from the book’s website.

  Note If the license agreement doesn’t appear, you can access

  it from the same webpage from which you downloaded the InsideDynaAX2012_667105_CompanionContent.zip file.

Using the code samples

  The code examples referenced in each chapter are provided as both .xpo files that you can import into Microsoft Dynamics AX and Visual Studio projects that you can open through the corresponding .csproj files. Many of these examples are incomplete, and you cannot import and run them successfully without following the steps indicated in the associated chapter.

  Acknowledgments We want to thank all the people who assisted us in bringing this book to press.

  We apologize for anyone whose name we missed.

Microsoft Dynamics product team Special thanks go to the following colleagues, whom we’re fortunate to work with

  Margaret Sherman, who pitched the book to Microsoft Press, provided us with training in how to use templates and style sheets, created a schedule for writing, prodded us when we needed prodding to keep the writing process moving along, and provided editorial feedback on every chapter. Thank you, Margaret. This book absolutely would not have seen the light of day without you!

  Mark Baker and Steve Kubis, who contributed ace project management and editing work. Hal Howard, Richard Barnwell, and Ann Beebe, who sponsored the project and provided resources for it.

We’re also grateful to the following members of the product team, who provided us with the reviews and research that helped us refine this book:

  Ned Baker Ian Beck Andy Blehm Jim Brotherton Ed Budrys Gregory Christiaens Ahmad El Husseini Josh Honeyman Hitesh Jawa Vijeta Johri Bo Kampmann Vinod Kumar Josh Lange Mey Meenakshisundaram

  Igor Menshutkin Jatan Modi Sasha Nazarov Adrian Orth Christopher Read (Entirenet) Bruce Rivard Gana Sadasivam Alex Samoylenko Karen Scipi Ramesh Shankar Tao Wang Lance Wheelwright Chunke Yang Arif Kureshy

  In addition, we want to thank Joris de Gruyter of Streamline Systems LLC. His SysTestListenerTRX code samples on CodePlex (

  , and his collaboration as we investigated this approach for executing SysTests

  from Microsoft Dynamics AX were valuable resources as we prepared the chapter on testing.

Microsoft Press

  Another big thank-you goes to the great people at Microsoft Press for their support and expertise throughout the writing and publishing process.

  Valerie Woolley, the Content Project Manager for the book, who provided ongoing support and guidance throughout the life of the project. Anne Hamilton—Acquisitions Editor Christian Holdener—Production Project Manager with S4Carlisle Publishing Services Allan Iversen—Technical Reviewer Andrew Jones—Copy Editor

New arrivals

  Finally, we would like to welcome the following youngest members of the Microsoft extended family, the children and grandchildren of the authors who arrived during the months that we were laboring on this book:

  Charlie Hendrix Bird Kayden John Healy Grace Elizabeth Marie Garty Amrita Nalla Gavin Roy Healy Nilay Pandya

Errata & book support

  We’ve made every effort to ensure the accuracy of this book and its companion content. Any errors that have been reported since this book was published are listed on our Microsoft Press site at oreilly.com:

  http://go.microsoft.com/FWLink/?Linkid=263523

If you find an error that is not already listed, you can report it to us through the same page

  If you need additional support, email Microsoft Press Book Support at Please note that product support for Microsoft software is not offered through the addresses above.

We want to hear from you

  At Microsoft Press, your satisfaction is our top priority, and your feedback our most valuable asset. Please tell us what you think of this book at

  

  The survey is short, and we read every one of your comments and ideas. Thanks in advance for your input!

  Stay in touch

  Let’s keep the conversation going! We’re on Twitter

  PA R T I A tour of the development environment

  

  CHAPTER 1 Architectural overview . . . . . . . . . . . . . . . . . . . . . . . . . 3 CHAPTER 2 The MorphX development environment

  and tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19

  CHAPTER 3 Visual Studio tools for Microsoft Dynamics AX . . . 73 CHAPTER 4 The X++ programming language . . . . . . . . . . . . . . .87

C H A P T E R 1

Architectural overview In this chapter

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 The Microsoft Dynamics AX five-layer

  solution architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 The Microsoft Dynamics AX application platform architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 The Microsoft Dynamics AX application meta-model architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Introduction

  The Microsoft Dynamics AX solution is an enterprise resource planning (ERP) solution that integrates financial resource management, operations resource management, and human resource m anagement processes that can be owned and controlled by multinational, multi-company, and multi-industry organizations, including the public sector. The Microsoft Dynamics AX solution encompasses both the Microsoft Dynamics AX application and the Microsoft Dynamics AX application platform on which it is built. The Microsoft Dynamics AX application platform is designed to be the platform of choice for developing scalable, customizable, and extensible ERP applications in the shortest time possible, and for the lowest cost. The following key architectural design principles make this possible.

  ■ Separation of concerns A Microsoft Dynamics AX end-to-end solution is delivered by many

  development teams working both inside Microsoft, inside the Microsoft partner channel, and inside end-user IT support organizations. The separation of concerns principle realized in the Microsoft Dynamics AX architecture makes this possible by separating the functional concerns of a solution into five globalized, secure layers. This separation reduces functional overlap between the logical components that each team designs and develops.

  ■ Separation of processes A Microsoft Dynamics AX end-to-end solution scales to satisfy

  the processing demands of a large number of concurrent users. The separation of processes principle that is realized in the Microsoft Dynamics AX architecture makes this possible by separating processing into three-tiers—a data tier, a middle tier, and a presentation tier. The Microsoft Dynamics AX Windows client, the Microsoft Dynamics AX Enterprise Portal web client, and the Microsoft Office clients are components of the presentation tier; the Microsoft Dynamics AX Application Object Server (AOS), the Microsoft Dynamics AX Enterprise Portal extensions to Microsoft SharePoint Server, and Microsoft SQL Server Reporting Services (SSRS) are components of the middle tier; the SQL Server and Microsoft SQL Server Analysis Services (SSAS) are components of the data tier of the Microsoft Dynamics AX platform architecture.

  ■ Model-driven applications A Microsoft Dynamics AX application team can satisfy

  application domain requirements in the shortest time possible. The model-driven application principle that is realized in the Microsoft Dynamics AX architecture makes this possible by separating platform-independent development from platform-dependent development, and by separating organization-independent development from organization-dependent development. With platform-independent development, you can model the structure and specify the behavior of application client forms and reports, of application object entities, and of application data entities that run on multiple platform technologies such as the Microsoft Dynamics AX Windows client, SharePoint Server, SQL Server, and the Microsoft .NET Framework. With organization-independent development, you can use domain-specific reference models, such as the units of measure reference model; domain-specific resource-models, such as the person, product, and location models; and domain-specific workflow models, such as approval and review models, which are relevant to all organizations.

Microsoft Dynamics AX five-layer solution architecture

  The Microsoft Dynamics AX five-layer solution architecture, illustrated in Figure 1-1, logically partitions a Microsoft Dynamics AX solution into an application platform layer, a foundation a pplication domain layer, a horizontal application domain layer, an industry application domain layer, and a vertical application domain layer. The components in all architecture layers are designed to meet Microsoft internationalization, localization, and security standards, and all layers are built on the Microsoft technology platform.

  Note

  The layers in the Microsoft Dynamics AX five-layer architecture are different from the model layers that are part of the Microsoft Dynamics AX customization framework described later in this book. Architectural layers are logical partitions of an end-to-end solution. Customization layers are physical partitions of application domain code. For more information, see Chapter 21, “Application models.” The Microsoft Dynamics AX application platform and application domain components are delivered on the Microsoft technology platform. This platform consists of the Windows client, the

  Office suite of products, Windows Server, SQL Server, SSAS, SSRS, SharePoint Server, the Microsoft ASP.NET web application framework, the .NET Framework, and the Microsoft Visual Studio integrated development environment (IDE).

  Security

  Localization

  3. Horizontal Application domain

  Internationalization

  1. Application platform

  2. Foundation Microsoft technology platform FIGURE 1-1 Microsoft Dynamics AX five-layer architecture.

  The following logical partitions are layered on top of the Microsoft technology platform:

  ■ Layer 1: Application platform layer The application platform layer provides the system

  frameworks and tools that support the development of scalable, customizable, and extensible application domain components. This layer consists of the MorphX model-based development environment, the X++ programming language, the Microsoft Dynamics AX Windows client framework, the Enterprise Portal web application framework, the AOS, and the application platform system framework. The architecture of the components in the application platform layer is described in the following section.

  ■

Layer 2: Foundation application domain layer The foundation application domain

  layer consists of domain-specific reference models in addition to domain-specific resource modeling, policy modeling, event documenting, and document processing frameworks that are extended into organization administration and operational domains. Examples of domain-specific reference models include the fiscal calendar, the operations calendar, the language code, and the unit of measure reference models. Examples of domain-specific resource models include the party model, the organization model, the operations resource model, the product model, and the location model. The source document framework and the accounting distribution and journalizing process frameworks are also part of this layer. Chapter 19, “Application frameworks,” describes the conceptual design of a number of the frameworks in this layer.

  ■ Layer 3: Horizontal application domain layer The horizontal application layer consists of

  application domain workloads that integrate the financial resource, operations resource, and human resource management processes that can be owned and controlled by organizations. Example workloads include the operations management workload, the supply chain management workload, the supplier relationship management workload, the product information management workload, the financial management workload, the customer relationship management workload, and the human capital management workload. The Microsoft Dynamics AX application can be extended with additional workloads. (The workloads that are part of the Microsoft Dynamics AX solution are beyond the scope of this book.)

  ■ Layer 4: Industry application domain The industry application layer consists of application

  domain workloads that integrate the financial resource, operations resource, and human resource management processes that are specific to organizations that operate in particular industry sectors. Example industries include discrete manufacturing, process manufacturing, distribution, retail, service, and public sector. Workloads in this layer are customized to satisfy industry-specific requirements.

  ■ Layer 5: Vertical application domain The vertical application layer consists of application

  domain workloads that integrate the financial resource, operations resource, and human resource management processes that are specific to organizations that operate in a particular vertical industry and to organizations that are subject to local customs and regulations. Example vertical industries include beer and wine manufacturing, automobile manufacturing, government, and advertising professional services. Workloads in this layer are customized to satisfy vertical industry and localization requirements.

Microsoft Dynamics AX application platform architecture

  The architecture of the Microsoft Dynamics AX application platform supports the development of Windows client applications, SharePoint web client applications, Office client integration applications, and third-party integration applications. Figure 1-2 shows the components that support these application configurations. This section provides a brief description of the application development environments, and a description of the components in each of the data, middle, and presentation tiers of the Microsoft Dynamics AX platform architecture.

Application development environments

  The Microsoft Dynamics AX application platform includes two model-driven application development environments:

  ■ Microsoft Dynamics AX MorphX development environment Use this development

  environment to develop data models and application code using the Application Object Tree (AOT) application modeling tool and the X++ programming language. This development environment accesses Microsoft Dynamics AX application server services through Microsoft Remote Procedure Call (RPC) technology.

  ■ Visual Studio Use this development environment to develop Microsoft .NET plug-ins for and

  extensions to Microsoft Dynamics AX clients, servers, and services; to develop for Enterprise Portal, and to develop SSRS reports. This development environment accesses the Microsoft Dynamics AX application server services through RPC.

  External applications Microsoft Office Word add-in, Excel add-in Other applications File Application services Application integration services System services SharePoint content database SharePoint configuration database Microsoft Dynamics AX application and model database SSRS database SSAS database

  .NET Framework 4.0 WCF RPC Exchange Server File system MSMQ BizTalk server WCF adapter Help web services Web services Enterprise portal framework .NET Business Connector

HTTP/HTTPS

Microsoft Dynamics AX reporting extensions

HTTP/HTTPS

MorphX .NET Business Connector Visual Studio Enterprise Portal web client Application pages using ASP.NET Business overview web part Report viewer web part Role center pages Windows Server AOS services

  Microsoft Dynamics AX application server SQL Server Data tier Middle tier Presentation tier

  Microsoft Dynamics AX Windows client Report viewer control MorphX forms and .NET controls Business overview web part Report viewer web part Role center pages SSAS SSRS

  Development environments File/MSMQ/WCF HTTP/HTTPS HTTP/HTTPS HTTP/HTTPS

  Internet Information Services (IIS) HTTP/HTTPS File/SMTP/MSMQ/WCF

FIGURE 1-2 Architecture of Microsoft Dynamics AX. Data tier of the Microsoft Dynamics AX platform

  The SQL Server database is the only component in the data tier. The database server hosts the Share- Point Server content and configuration databases, the Microsoft Dynamics AX model and application database, the SSRS database, and the SSAS database.

Middle tier of the Microsoft Dynamics AX platform

  The middle tier includes the following components:

  ■ AOS The AOS executes MorphX application services that are invoked through RPC

  technology and Windows Communication Foundation (WCF) technology in the .NET Framework. The AOS can be hosted on one computer, but it can also scale out to many computers when additional concurrent user sessions or dedicated batch servers are required.

  ■ .NET Framework components These components can be referenced in the AOT so that

  their application programming interfaces are accessed from X++ programs. The Windows Workflow Foundation (WWF) component is integral to the Microsoft Dynamics AX w orkflow framework, and WCF is integral to the Microsoft Dynamics AX application integration framework.

  ■ SQL Server Analysis Services (SSAS) These services process requests for analytics data hosted by the SQL Server component in the data tier.

  ■

SSRS and Microsoft Dynamics AX reporting extensions The reporting extensions

  provide SSRS with features that are specific to the Microsoft Dynamics AX application platform. These extensions access the AOS through WCF services and access SSAS through HTTP and HTTPS.

  ■

Microsoft Dynamics AX Enterprise Portal framework This framework extends the

  SharePoint application platform with features that are specific to the Microsoft Dynamics AX application platform. The Enterprise Portal framework composes SharePoint content with Microsoft Dynamics AX content accessed from the AOS through the .NET Business Connec- tor and RPC, and content accessed from SSAS and SSRS through HTTP and HTTPS. Enterprise Portal is typically hosted on its own server or in a cluster of servers.

  ■

Microsoft Dynamics AX Help web service This web service processes requests for

Help content.

  ■ Web services hosted by Microsoft Internet Information Services (IIS) The Microsoft Dynamics AX system services can be deployed to and hosted by IIS.

  ■ Application Integration services These services provide durable message queuing and transformation services for integration clients.

Presentation tier of the Microsoft Dynamics AX platform

  The presentation tier consists of the following components:

  ■ Windows client This client executes Microsoft Dynamics AX MorphX and .NET programs devel-

  oped in MorphX and Visual Studio. The client application communicates with the AOS primarily by using RPC. The client composes navigation, action pane, area page, and form controls for rapid data entry and data retrieval. Form controls have built-in data filtering and search capabilities and their content controls are arranged automatically by the Intellimorph rendering technology. The client additionally hosts role center pages rendered in a web browser control.

  ■

Enterprise Portal web client This client executes MorphX application models, X++

  programs, and .NET Framework programs developed in the MorphX development environment, Visual Studio, and the SharePoint Server framework. Enterprise Portal is hosted by the Microsoft Dynamics AX runtime, the ASP.NET runtime, and the SharePoint runtime environments. SharePoint and ASP.NET components communicate by means of the Microsoft Dynamics AX .NET Business Connector.

  ■ Office clients The Microsoft Word client and Microsoft Excel client are extended by add-ins

  that work with the Microsoft Dynamics AX platform.

  ■ Third-party clients These clients integrate with the Microsoft Dynamics AX platform by

  means of integration service components such as the file system, Microsoft Message Queuing (MSMQ), Microsoft BizTalk Server, and a WCF adaptor.

Microsoft Dynamics AX application meta-model architecture

  Microsoft Dynamics AX application meta-model architecture is based on the principle of model- driven application development. You declaratively program an application by building a model of application components instead of procedurally specifying their structure and behavior with code. The Microsoft Dynamics AX development environment supports both model-driven and code-driven application development.

  A model of an application model is called a meta-model. Figure 1-3 shows the element types in the Microsoft Dynamics AX application meta-model that you use to develop Microsoft Dynamics AX Windows client applications.

  Note

  To keep the diagram simple, the figure does not list all type dependencies on model element types.

  Table Security Map Perspective View collection

  Base policy enum

  Table Extended data Form SSRS Info type Form Report Query Reference Macro part report part Job

  Menu Class item Cue Service Code

  Cue Service group group permission Workflow Workflow

  Menu Role approval provider Workflow type

  Process Duty Workflow cycle task

  Privilege FIGURE 1-3

  Element types of the Microsoft Dynamics AX meta-model for developing Microsoft Dynamics AX Windows client applications.

Application data element types

  The following model element types are part of the Microsoft Dynamics AX application data meta-model:

  ■

Base enum Use a base enumeration (base enum) element type to specify value type

  application model elements whose fields consist of a fixed set of symbolic constants. For example, you can create a base enum named WeekDay to name a set of symbolic constants that includes Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.

  ■

Extended data type Use an extended data type element type to specify value type

  application model elements that extend base enums, in addition to string, boolean, integer,

  real, date, time, UtcDateTime, int64, guid, and container value types. The Microsoft Dynamics

  AX runtime uses the properties of an extended data type to generate a database schema and to render user interface controls. For example, you could specify an account number extended data type as an extension to a string value type that is limited to 10 characters in length, and that is described using the Account number label when bound to a user interface text entry control. Extended data types also support inheritance. For example, an extended data type that defines an account number can be specialized by other extended data types to define customer and vendor account numbers. The specialized extended data type inherits properties, such as string length, label text, and help text. You can override some of the properties on the specialized extended data type.

  ■ Table Use a table element type to specify data entity types that the Microsoft Dynamics AX

  application platform uses to generate a SQL Server database table schema. Tables specify data entity type fields along with their base enum or extended data type, field groups, indexes, relationships, delete actions, and methods. Tables can also inherit the fields of base tables that they are specified to extend. The Microsoft Dynamics AX runtime uses table specifications to render data entry presentation controls and to maintain the referential integrity of the data stored in the application database. The X++ editor also uses table elements to provide IntelliSense information when you write X++ code that manipulates data stored in the application database. Tables can be bound to form, report, query, and view data sources.