Develop and customize Dynamics AX safely and effectively
Transcript of Develop and customize Dynamics AX safely and effectively
![Page 1: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/1.jpg)
Develop and customize Dynamics AX safely and effectivelyPeter VilladsenPrincipal Program Manager
BRK4026
![Page 2: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/2.jpg)
Developer Experience
![Page 3: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/3.jpg)
• Ax Applications are typically mission critical.
• Development is complex.• Understanding the problem space is
prerequisite for developing.• Requires modern best practices in software
development: SCC, encapsulation, patterns, test etc.
Characteristics of Dynamics AX development
![Page 4: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/4.jpg)
Metadata + Code == Application
![Page 5: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/5.jpg)
• Application development for AX7:• Takes place in the X++ language, with some C# when needed.• Takes place entirely within Visual Studio.• Is based on a solid metadata foundation.• Is supported by a strong lifecycle management support infrastructure.
The Developer Experience
![Page 6: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/6.jpg)
• X++ is a type-safe Object Oriented Programming language, in the style of C# and Java.
• It features several innovations that allow it to better support the development of ERP systems.
• X++ is backed by a full stack of compiler, debugger, profiling tools, cross reference tools etc.
• X++ generates MSIL code.
The X++ language
![Page 7: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/7.jpg)
• X++ provides abstractions for:• Classes, tables, views, queries, extended data types, enumerations, …
• X++ provides all the common OO features:• Inheritance, polymorphism, static/instance methods, encapsulation,
late binding, …• X++ has first-class data access support:• Select, insert_recordset, update, delete_from etc.
• Has a few bleeding edge features:• Extension classes, Class augmentation, Type Providers.
The X++ language
![Page 8: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/8.jpg)
• Visual Studio is the environment for developing AX7 applications.
• Strong integration is provided:• Supports the concepts of models and packages.• Full support for editing both code and metadata through designers.• X++ editor featuring intellisense, colorization etc.• Backed by cross reference database for navigation.• Full support for the Visual Studio debugger.• Seamless error message handling.
Visual Studio
![Page 9: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/9.jpg)
• It is quite possible to add keyboard code snippets for boilerplate code etc.
• It is also possible to add your own AX extensions.• Global Add-ins• Add-ins per artifact type
Visual Studio Extensibility
![Page 10: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/10.jpg)
AX7 Visual Studio Extensibility optionsPeter Villadsen
![Page 11: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/11.jpg)
• A new, high-performance compiler has been provided.
• It powers the compilation, but also other scenarios• Best practices• Analysis of breaking changes.• Ad-hoc tools.
• Metadata and some intellsense is powered by a background process, the xppcAgent.
Visual Studio: X++ compiler stack
![Page 12: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/12.jpg)
Demo
The Dynamics ‘AX 7’ Visual Studio Development Tools
![Page 13: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/13.jpg)
The development environmentAX 7 Development Environment
Visual StudioLocal runtime
Metadata (model store)
‘AX 7’ Extensions:
• Project system• X++ code editor• Designers• Application Explorer• Design time meta-model• Best practice integration• …others AOS hosted by
IISDeployment Package(metadata and binaries)
Business Databas
e
Deploy to cloud environment
Metadata APIRuntime
Debug/Run (F5)
Build
Model binaries (File system)
Batch manager service
![Page 14: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/14.jpg)
• A Dynamics ‘AX 7’ model is a group of elements (metadata and source files) that typically constitute a distributable software solution (including customizations of an existing solution). A model is a design-time concept. • For example: A warehouse management model, a project accounting model, …etc.)
Concepts: Model
![Page 15: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/15.jpg)
• A Dynamics ‘AX 7’ package is a deployment and compilation unit of one or more models. It includes model metadata, binaries, cubes and other associated resources. One or more ‘AX 7’ packages can be package into a deployment package, which is the vehicle used for deployment on UAT and production environments.
Concepts: Package
![Page 16: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/16.jpg)
Packages, Models and VS ProjectsProjects, models and packages
'AX 7' Project
1 'AX 7' Model 1(Example: Application
Suite)'AX 7' Project
2'AX 7' Project
3
'AX 7' Project
6 'AX 7' Model 3(Example: Unit tests)'AX 7'
Project 7
Package 1 (Assembly and
associated runtime files)
'AX 7' Project
4'AX 7' Project
5
'AX 7' Model 2(Example: Expense)
Package 2 (Assembly and
associated runtime files)
Depends on
![Page 17: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/17.jpg)
Application ExplorerIn model view, Application Explorer is organized by models.Each model is a child node of the AOT root node.The package that a model belongs to is shown in parenthesis next to the model name.
Microsoft Confidential
![Page 18: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/18.jpg)
Packages on disk• Packages are folders located
in the model store folder of the Dynamics ‘AX 7’ application.
• The default model store folder is typically “c:\packages\”.
• Here you can see the folders of the ApplicationSuite package and the ApplicationFoundation package among others.
Microsoft Confidential
![Page 19: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/19.jpg)
Models on disk• Model folders are contained in their
package folder.• A model folder contains type-
specific folders. • For example all tables in a model
belong to the folder AxTable.• The image on the right shows the
FleetManagement model folder.• The FleetManagement model folder
belongs to the FleetManagement package folder.
Microsoft Confidential
![Page 20: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/20.jpg)
Model Descriptors• A package folder
contains a descriptor folder that lists all models that belong to the package.
• A model descriptor file contains metadata about a model’s properties.
• The image on the right shows 2 descriptor files of 2 models that belong to the FleetManagement package.
Microsoft Confidential
![Page 21: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/21.jpg)
Full build dialogAccess the full build dialog from Dynamics ‘AX 7’ > Build models…All packages are listed, one package = one compiled assembly.Models within a package are shown in brackets.
Microsoft Confidential
![Page 22: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/22.jpg)
Supported extensions as of today
Metadata• Create new elements (All AX types)• Extend tables: • Add new field, add field to field group, add
new field group, add new index, add new relation
• Extend forms:• Add a control, Add a form part, add a data
source, change the label, caption, help text, visible, and enabled properties of an existing control.
• Extend menus: • Add submenu, add menu item, add tile, hide
menu item.• Extend enums, security duties/roles.• Extend EDTs • Change label, fornhelp, and string size
properties.• Extend data entities, queries, views• Add field mappings to maps.
Source Code• Create new X++ classes• Application events
• Create event handlers (For app delegates)
• Framework events• Create data event handlers
(tables)• Create form event handlers• Create form data source and
data field event handlers• Create event handler for form
control events• Create plugins• Create static extension methods to
classes and tables.• Create static and instance methods
and add state through class augmentation.
![Page 23: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/23.jpg)
Package dependencies graphMicrosoft Confidential
Right-click on the AOT and select View package dependencies to generate a graph depicting dependencies between packages of your application.
![Page 24: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/24.jpg)
Demo
The X++ Metadata
![Page 25: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/25.jpg)
Customization
![Page 26: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/26.jpg)
Customization Concepts in Dynamics ‘AX 7’
Example-1: Overlayering customizations in base package
Assembly (Microsoft. Dynamics.Application.dll)
ISV-1 Overlay of
MS
ISV-2 Overlayof MS
VAR Overlay of ISV-1 and ISV-2
MS Application Suite Model
Overlayering model (Granular metadata and code customizations)Extension model (Metadata and code extensions) Example-2: Extension based
customizations in separate packages
Assembly ISV2.Extensio
ns.dll
Assembly (Microsoft. Dynamics.Application.dll)
ISV-1 Extensions on MS
Assembly (VAR.Extensions.dll)VAR Extensions on ISV-1 and
ISV-2
MS Application Suite Model
Assembly ISV2.Extensio
ns.dll
ISV-2 Extensions on MS
Example-3: Hybrid scenario with both extension and over-layering
Assembly ISV1.Extensi
ons.dll
Assembly (Microsoft. Dynamics.Application.dll)
ISV-1 Extensions on MS
Assembly (VAR.Extensions.dll)VAR Extensions on ISV-1 and
ISV-2
MS Application Suite Model
Assembly ISV2.Extensions
.dll)
ISV-2 Extensions
on MS
VAR Overlay of ISV-2
ISV-1 Overlay of
MS
![Page 27: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/27.jpg)
• Pros:• Any piece of metadata or code can be modified in a granular (but
intrusive) way: You are essentially making it your own so you can do what you want with it.
• Cons• You are now responsible for the code that you are overriding. When
changes are made to that (original) code, you may have a hard time reconciling it with your changes: You sometimes have to start from scratch. Huge costs are incurred.
• Over-layering does not work in the cloud. The changes made by a partner are compiled into the assembly that is deployed. There is no separation of the IP.
• ISVs essentially have no guarantees that the application still runs correctly.
• You cannot use overlayering in the platform and foundation models.
Overlayering
![Page 28: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/28.jpg)
Extensions: Concept and value proposition
Application Suite Package
Application Suite Extension Package
AOS RuntimeDynamics.AX.ApplicationSuite.dll
Dynamics.AX.AppSuiteExtension.dll
AxFormAxTableAxTableExtension
AxFormExtension
AxForm
AxTableEvents & Plugins
References
Code Extensions
AxClass
CompileCompile
Compile Isolation & performance
Deployment, servicing and ALM
Minimal code upgrade cost
![Page 29: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/29.jpg)
• Pros• Lightweight compilation: You are only compiling changes.• With ALM, you’ll only manage your extension artifacts. This
simplifies and improves the performance of deployments and test automation.• Servicing is reduced to copying DLLs with no impact to
partner customizations.• There is a loose coupling between the original code and
partner code. There is a very good chance that you will not have to react to changes made: No costly reimplementation. • It is very easy to get rid of the changes made by extension:
Just remove the assembly and restart.
Extensions
![Page 30: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/30.jpg)
• Cons• You cannot easily achieve everything; You cannot change the
implementation of a particular method, for instance. • Not all metadata is extensible yet (but we are close).• Private / protected / public ?• Does not expose virtual behavior.
Extensions
![Page 31: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/31.jpg)
Demo
Customizations
![Page 32: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/32.jpg)
• Always extend rather than overlayer.• Prepare your code to be extended.• Heed the best practice warnings!• Test early, test often, test automatically• Do code reviews. Always. Really.
Advice
![Page 33: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/33.jpg)
Free IT Pro resourcesTo advance your career in cloud technology
Cloud role mapping Expert advice on skills needed Self-paced curriculum by cloud role $300 Azure credits and extended trials Pluralsight 3 month subscription (10 courses) Phone support incident Weekly short videos and insights from Microsoft’s leaders and engineers Connect with community of peers and Microsoft experts
Microsoft IT Pro Career Centerwww.microsoft.com/itprocareercenter
Microsoft IT Pro Cloud Essentials www.microsoft.com/itprocloudessentials
Microsoft Mechanics www.microsoft.com/mechanics
Microsoft Tech Community https://techcommunity.microsoft.com
Plan your career path
Get started with Azure
Connect with peers and experts
Demos and how-to videos
![Page 34: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/34.jpg)
From your PC or Tablet visit MyIgnite at http://myignite.microsoft.com
From your phone download and use the Ignite Mobile App by scanning the QR code above or visiting https://aka.ms/ignite.mobileapp
Please evaluate this sessionYour feedback is important to us!
![Page 35: Develop and customize Dynamics AX safely and effectively](https://reader033.fdocuments.us/reader033/viewer/2022051404/584abd3f1a28ab85738bd7e1/html5/thumbnails/35.jpg)
© 2016 Microsoft Corporation. All rights reserved.