ClassroomPPT
ClassroomPPT
ClassroomPPT
As part of the Resource Materials there are several elements including; Student Online Companion Guide,
Instructor Presentation (PPT), Test Your Knowledge Questions (TYKQ’s) , and Lab/Practices. All of these materials
are for the instructor use, except for the Student Companion Guide, this is the students take away from this
course.
Instructor Notes:
The slide deck for this course is the primary guide for the instructor this will correspond to the companion guide
to some degree. However, the printed transcript may not align 100%. Suggestion would be to review this deck
and polish it to fit your needs. Practice the labs and demonstrations ahead of time, add own content to add
additional student value outside of the eLearning. However the two can be used in conjunction.
eLearning - You might choose to complement your classroom experience by leveraging various components of
the eLearning for this course. If you look within the notes of the PowerPoint slide deck for this course, you’ll find
the names of the various sections within the eLearning where each lesson and demonstration are covered. The
eLearning will cover the following topics:
Timeline – Total Course Duration: 20 Hours
Module Description Time to Complete
Introduction .5 Hour
1 Introduction to Visual Studio .5 Hour
2 Architecture 1 Hour
3 Labels and Resources 1 Hour
4 Base Enumerations 1 Hour
5 Extended Data Types 1 Hour
6 Tables 1 Hour
7 Table Indexes 1 Hour
8 Table Relations 1 Hour
9 Form Patterns 2 Hours
10 Form Creation 1 Hour
Dynamics AX
Course Objectives
• Introduce Visual Studio development
environment and architecture.
• Create and customize elements.
• Create tables and define relationships
• Create forms, assign form patterns, and menus.
• Develop X++ code.
• Configure basic security.
• Introduce advanced topics.
Scenario
PROPOSAL – Fleet Management
System
• Make • Maintenance Type
• Model • Date of service
• Fuel Type • Hours
• VIN • Parts used
• And so on • Notes
Vehicle
Vehicle Table Maintenance
Table
Module 1
Introduction to Visual Studio
Module Objectives
• Configure the development environment.
• Define terminology and concepts.
• Demonstrate basic navigation.
• Create projects, models and packages.
• Create and use elements.
• Building elements.
Fleet Management Scenario
Model &
Package Project
System Requirements
Element
Models
s
Package
Projects
s
Projects, Models and Packages
Naming Conventions
Avoid
Using camel reserved
case words
Model View
Solution Explorer
Properties window
Code editor
Overlayering
Creating a model Updating model
vs.
with the wizard parameters
Extension
Overlayering and Extensions
Overlayering
Extension model
(Customizations)
Demonstration
• Creating a model using the wizard
Demonstration
• Updating model parameters
Project Properties
Property Description
The type of object that will be used as the Startup Object when the project is run.
The following types are available:
Startup Object type Form
Class
Output menu item
Startup Object The object that will be invoked when the project is run.
Company The default company that will be used when the project is run.
Partition The partition that will be used when the project is run.
Project File The name of the file that contains information about the project.
Project Folder The location of the project.
The model that the project is associated with. All elements in the project must be
Model
in the selected model.
Model Publisher A read-only value that indicates the publisher of the model.
Layer A read-only value that indicates the application layer that the model is located in.
A value that indicates whether the synchronize operation for tables will be
Synchronize database on build
performed when the build action is performed for the project.
Demonstration
• Creating a new project to add to the Fleet
Management model.
Demonstration
• Importing and Exporting Projects
Practice: Create a Project
Scenario:
Simon, the Systems Developer for Contoso, is tasked with
creating a new model for the Fleet Management System in
Visual Studio. He is to ensure that it is ready for element
creation and that the project builds. This practice is in
continuation of the previous practice
Elements
Element
designer
Finding Setting
related element
elements properties
Element Designer
Element Properties
Can be organized in
various ways
Compilation
and creation Report RDL
of .NET generation
assemblies
Label and
Database
resource file
synchronization
generation
Demonstration
• Building and rebuilding a project
• Understanding build results
Practice: Build and Compile
Scenario:
Simon, the Systems Developer for Contoso, is tasked with
creating a new model for the Fleet Management System in
Visual Studio. He is to ensure that it is ready for element
creation and that the project builds. This practice is in
continuation of the previous practice.
Module Review
Introduction to Visual Studio
Test Your Knowledge Question
1. TRUE OR FALSE. A Visual Studio project can
belong to more than one model.
a) True
b) False
Test Your Knowledge Question
2. What is a Dynamics ‘AX 7’ model?
a) A model is a Visual Studio project.
b) A model is a collection of elements (metadata/source
files) that represent a distributable software solution.
c) A model is a file used to deploy customizations to a
production environment
Test Your Knowledge Question
3. What does an element’s XML file contain?
a) Only metadata about the element
b) Only source code for the element
c) Metadata and source code for the element
d) Metadata and source code for the element and all
related elements
Test Your Knowledge Question
4. Which operation forces a build of all elements,
regardless of whether they have changed or not?
a) A project build
b) A model build
c) A rebuild
Test Your Knowledge Question
5. How can you visualize elements organized by
model (Model View)?
a) By going to the View menu on the toolbar and
choosing Model View
b) By right-clicking on the AOT node in the Application
Explorer and choosing model view
c) By right-clicking any model and choosing model view
d) By navigating to the ‘AX 7’ menu and choosing model
view
Module 2
Architecture
Module Objectives
• Describe the elements included in the
application stack.
• Review the server architecture.
• Explain the cloud architecture used with
Dynamics AX.
Application Stack
Fleet
Application Suite
Management
Application Foundation
Application Platform
Forms Engine
Workflow Batch
Aggregate Data
Data Access Layer Data Store base
Server Architecture
Organized by model.
Cloud Architecture
Lifecycle
Services
Cloud
Architecture
Shared Dynamics
services AX
Microsoft Azure
Module Review
Architecture
Test Your Knowledge Question
1. Which of the following is NOT a model in the
application stack?
a) Application Foundation
b) Application Core
c) Application Suite
d) Application Platform
Test Your Knowledge Question
2. TRUE or FALSE. Model stores are represented
as a set of folders and XML artifacts.
a) True
b) False
Test Your Knowledge Question
3. Lifecycle Services and Microsoft Azure are
services that relate to which architecture
component in Dynamics AX?
a) Server Architecture
b) Application Stack
c) Virtual Architecture
d) Cloud Architecture
Module 3
Labels and Resources
Module Objectives
• Learn about labels in AX
• Review the purpose of labels for Fleet
Management.
• Create and use both label files and labels.
• Explore the search capability of the label editor.
• Review best practices for labels.
• Learn about resources.
• Create and use resources.
About Labels
Create a
Label
File
Create
labels
when Build
needed
Demonstration
• Create a label file and a label
Demonstration
• Search Labels
Best Practices for Labels
Ensure that
labels contain
Use labels for
appropriate
every element
translation of
or artifact
activity or
item
Icons
Visual
Pictures
representations
Resources
Create and Use Resources
0 = Value A
1 = Value B
2 = Value C
3 = Value D
…
Base Enumeration Examples
Sales
No/Yes order
status
ABC Posting
Codes types
Demonstration
• Open the Project.
• Create a new base enumeration.
• Set key properties on the base enumeration.
Practice: Create Base Enumerations
Scenario:
• For our fleet management scenario, we will need to build three enumerations. These will aid in tracking the
vehicle type, service type, and the fuel type.
• Simon, our AX developer, will need to create three base enumerations needed for our model.
• -dbfmServiceType
• None
• Registration
• OilChange
• Maintenance
• Repair
» -dbfmVehicleType
• Car
• Truck
• Van
• SUV
• -dbfmFuelType
• Gas
Practice: Create Base Enumerations
Scenario:
• For our fleet management scenario, we will need to build three enumerations. These will aid in tracking the
vehicle type, service type, and the fuel type.
• Simon, our AX developer, will need to create three base enumerations needed for our model.
Determine
Configure
primitive properties Build
data type
The
Code is
properties
easier to
are
read
inherited
Provide
Reduce
consistenc
work
y
Demonstration
• Create a new string and review key properties
• Create a new date and review key properties
• Create a new integer and review key properties
• Create a new real and review key properties
• Create a new enum and review key properties
• Extend an existing EDT and override key
properties
Best Practices
Create a
table to Adds EDTs
Build
Add Set
store key (fields) datasources Properties
information
Set Create
Set labels
properties Queries
Set Title Build
About Tables
Stores business
transactions and Made up of
metadata used in records (rows)
the system
Name Category
Aaron Boy
Susan Girl
Derek Boy
Layla Girl
Tyler Boy
James Boy
Table Components
Demonstration
• Open the Fleet Management Project.
• Add a new table to the project
Demonstration
• Add elements to the newly created table
About Field Groups
Types of field
groups
Best practice
checks for field
groups
Demonstration
• Create a field group
• Add fields to the field group by drag and drop
• Add fields to the field group by right-clicking
Practice: Create Tables
Scenario:
• Two tables have been identified for the new fleet management module for Contoso
including a table to store basic vehicle information and a second table to store vehicle
maintenance information.
• The table for the vehicles will need to track the following information: fuel level, fuel type,
gross vehicle weight, inspection date, make, mileage, model, notes, number of doors,
seating capacity, third row seating, a unique vehicle ID, vehicle type, VIN and year.
• The table for maintenance will need to track the following information: service type,
engine description, service start and end dates, and the vehicle ID.
• For the Fleet Management Scenario Simon, the developer for Contoso, needs to create
tables to store information about the various types of vehicles in the fleet.
Key Table Properties
Support
ConfigurationKey ClusterIndex
Inheritance
Extends
Table Inheritance
May
contain
one or Highly
more flexible
tables as a
data source
• Labels
• Table types
• Form reference
• Created and
• Title fields modified fields
Best Practices for Table Fields
Use field
Use field
groups to
groups to
organize
design
related
forms
fields
Auto
Auto report
lookup
should have
reverts to
at least two
TitleField1
fields
and 2
Query Best Practices
Use queries
Create queries in Always use
instead of select
the Application queries as the
statements when
Explorer instead data source for
structure of
of X++ code Forms and
“select” is
when possible Reports
unknown
Module Review
Tables
Test Your Knowledge Question
1. Which two key properties work together to
control table inheritance?
a) The Support Inheritance and Table Type
properties
b) The Table Type and Extends properties
c) The Extends and Support Inheritance properties
d) The Allow Inheritance and Extends properties
Test Your Knowledge Question
2. What are the two main types of temporary
tables?
a) Regular and TempDB
b) Inherited table and TempDB
c) Regular and InMemory
d) InMemory and TempDB
Test Your Knowledge Question
3. TRUE or FALSE. If a modification is made to a
field group, such as a new field being added, any
forms that contain that field group will
automatically update to reflect the new addition.
a) TRUE
b) FALSE
Test Your Knowledge Question
4. What kind of data can found in the tables in
Dynamics AX? (Select two that apply)
a) Aggregated analytical data
b) Metadata, such as system settings
c) Business and transaction data
Test Your Knowledge Question
5. TRUE or FALSE. Queries are reusable elements
that can contain only one table as a data source.
a) TRUE
b) FALSE
Module 7
Table Indexes
Module Objectives
• Define the types of table indexes.
• Provide examples of each type.
• Create new table index.
Scenario
Creat
e Set
Parameters Build
Table
Primary Index
Clustered
Index
Non-
Clustered
Index
About Indexes
Indexes are associated with tables and make it easier to find specific
data
Creat
e Build
Set
Relation
parameters
Table
Add Add
Index(es) Relations
About Relations
Relations are defined between tables with related data
Field
Normal fixed
relation
Related
Foreign
field
Key
fixed
relation
relation
On Delete Property
Cascad
e
de Re
a
sc cted st ri c
a
C tri ted
e s
R
Demonstration
• Open the Fleet Management project and model
• Locate the FMVehicleMaintenance table from your
project
• Open the table designer and create a relation
Practice: Create a Table Relationship
Scenario:
Simon, the Systems Developer at Contoso, has identified
that the vehicle table and the vehicle maintenance table are
related to each other by the vehicle ID field in both tables.
Each vehicle record in the vehicle table can be related to
multiple maintenance records in the vehicle maintenance
table.
Best Practices
The configuration key that is specified for the field in a relation must be the same key,
or in the same tree of keys, as the key used for the related field.
When using navigational relationships, the Validate property must be set to “No”
Module Review
Table Relations
Test Your Knowledge Question
1. Which of the following values for the On Delete
property for a relation specifies to only permit
deletion of records in a table when there is nothing
that relates to it in another table?
a) Restricted
b) Cascade
c) Cascade + Restricted
d) None
Test Your Knowledge Question
2. TRUE or FALSE. It is a best practice to define the
relation on the table holding the Foreign Key.
a) True
b) False
Test Your Knowledge Question
3. Which two of the following types of relations can
only be created on numeric fields?
a) Normal relation
b) Field fixed relation
c) Related field fixed relation
d) Foreign Key Relation
Module 09
Form Patterns
Module Objectives
• Illustrate form pattern examples.
• Run the form patterns report.
• Apply patterns to forms.
• Apply sub patterns to form controls.
• Define important properties.
About Form Patterns
Simple List
Table of
Form Part Contents
Fact Boxes (Setup
Page)
Form
Details Operational
Master Pattern Workspaces
s
Demonstration
• Run Form Patterns report
• Locate forms with certain patterns or no
patterns applied.
Demonstration
• Show a Details Master form in UI
• Show in Form Designer
Demonstration
• Show Fact Box in UI
Demonstration
• Show Simple List pattern type in UI
Demonstration
Controls may
Applied in a
Can be added be prefixed
similar manner
to various form with “Pattern:
as Form
controls <unspecified>”
Patterns
after the name
Sub-pattern Types
e Fiel
ag
Im iew Fiel ds and
dG
Prev rou
ps
ers
Se Tiles
m
Filt
lec
sto
tio
Cu
k)
uic
n
(Q
Demonstration
• Show examples of Custom Filters
Demonstration
• Show image preview and field and field groups
sub patterns in UI and development
environment
Demonstration
• Show examples of section tiles sub-pattern
Demonstration
• Locate a control with an unspecified sub-pattern
• Apply an appropriate sub-pattern
Form Properties
Property Value Description
Page opens in View mode, and has an Edit button that toggles to
Done, Save, and Restore. Be aware that some page styles ignore
Form.Design.ViewEditMode Auto
the ViewEditMode property. For example, a dialog box doesn’t
use the ViewEditMode property.
The page opens in View mode and has no buttons that are
Form.Design.ViewEditMode View
related to editing the page. The page is “always view.”
The page opens in Edit mode, and has Save and Restore buttons.
Form.Design.ViewEditMode Edit
The page is “always editable.”
Form Properties
Property Value Description
Notifies user of
Allows for guided Ensures
errors and areas in
development consistency
need of correction
Form Statistics
• Summary of
form statistics
Dialo • Form pattern
g that name
shows • Percentage of
: controls that are
covered by the
pattern
Form Pattern Tab
Module Review
Form Patterns
Test Your Knowledge Question
1. TRUE or FALSE. Form patterns are applied to
a form’s design node, while form sub-patterns
are applied to certain form controls.
a) True
b) False
Test Your Knowledge Question
2. Which form pattern contains a vertical
arrangement of tabs and is commonly used for
Setup pages?
a) Simple List
b) Details Master
c) Operational Workspaces
d) Table of Contents
Test Your Knowledge Question
3. The Form Statistics dialog shows which of the
following pieces of information (select all that
apply):
a) The name of the applied form pattern
b) The pattern coverage percentage
c) The number of controls covered by a pattern
d) Total count of controls
Test Your Knowledge Question
4. TRUE or FALSE. The form patterns report is
a .csv file that is generated by Visual Studio.
a) True
b) False
Module 10
Form Creation
Module Objectives
• Create a form.
• Add data sources to a form.
• Define important form controls.
• Add controls and data types to a form.
• Apply patterns and sub-patterns to forms and
controls.
Scenario
Create
a form
Apply a
Pattern Build
Add a
Configure Data
Source
Demonstration
• Open the Fleet Management project
• Add two forms to the project
Practice: Create Forms
Scenario:
For the Fleet Management System the user interface elements of the forms will
need to be created. Following the standard, there will need to be full entry data
pages for both the Vehicle and Vehicle Management tables. In addition, there
will need to be a list page summarizing all of the Vehicles and link to the data
pages.
Simon, the developer for Contoso, needs to create a list page form and
supporting forms for the Vehicle and Vehicle Maintenance information.
Command Button
Menu Button
Toolbars
Simple
Read Only Style=List List grid
Grid Style Examples
Name the
Use the Use the Try to cover
form to
“Auto” and Form all controls Avoid
coincide with
“Default” Statistics with the placing code
the main
properties add-in for applied on forms
data source
for sizing guidance pattern
table
Module Review
Form Creation
Test Your Knowledge Question
1. TRUE or FALSE. Button groups can be placed
directly underneath the Action Pane control on a
form.
a) True
b) False
Test Your Knowledge Question
2. Setting the Grid Style property value to “Auto”
defaults to what type of Grid Style?
a) List Style
b) Simple Read Only Style
c) Tabular Style
d) Details Style
Test Your Knowledge Question
3. TRUE or FALSE. The Pattern tab in the pattern
information panel provides the developer with
guidance in terms of which controls are required,
and in what order. If a control for a particular form
pattern is missing or in the wrong order, the build
operation will still allow the user to run and view
the form in the currently developed state.
a) True
b) False
Test Your Knowledge Question
4. TRUE or FALSE. A form must have a form pattern
applied.
a) True
b) False
Test Your Knowledge Question
5. When all requirements for a form pattern have
been satisfied, what must be done first before
building and previewing the form in a browser
window?
a) Run the forms pattern report
b) Check the forms statistics add-in
c) Set the form you want to preview as the Start
Up object for the project
d) A rebuild of the form
Module 11
Menus
Module Objectives
• Review how to create and use menu items.
• Create menus and attach menu items.
Fleet Management Scenario
Menu item
parameters Menu Menu
item Build
buttons
About Menu Items
Display
Output
Action
Key Property Values on Display Menu Items
Form View
Option
Normal Image
Open Mode
Help Text
Label
Key Property Values on Output Menu Items
Enum
Enum
Type
Parameter
Parameter
Linked Linked
Permissio Permissio
n Object n Type
Key Property Values on Action Menu Items
Create Permissions
Delete Permissions
Extended Data
Security
Configuration Key
Demonstration
• Create a Menu Item
Practice: Create Menu Items
Scenario:
For the Fleet management scenario, we will need to build menu
items that point to the newly created forms. Then we will build a
menu to contain the top level form, the List page, and then link all of
the menus using Menu Extension to the existing menu structure of
AX. Lastly, we will create menu item buttons for the Vehicle and
Vehicle Maintenance forms.
Configuration Normal
Key Image
Label
Demonstration
• Create Menu
• Extend a Menu
• Test a Menu
Demonstration
• Update Forms with Menu items
Practice: Create a Menu
Scenario:
This practice is a continuation of the previous
practice.
Module Review
Menus
Test Your Knowledge Question
1. Suppose you want to attach an SSRS report
to a menu item, so that when a user clicks the
menu item, the report will display. Which type
of menu item should be used for this purpose?
a) Display
b) Action
c) Output
d) Window
Test Your Knowledge Question
2. TRUE or FALSE. Menus are prebuilt to include all
of the accessible items in AX from the Navigation
Pane, however, you can also add your own.
a) True
b) False
Module 12
X++ Overview
Module Objectives
• Explore the code editor.
• Review the controls of the compiler.
• Create a runnable class.
• Review IntelliSense feature for coding.
• Introduce variable declaration.
• Review basic syntax.
• Identify key words and operators.
Module Objectives
• Review the comparison tools
• Demonstrate how data types are used in code.
• Discuss the use of the debugger.
• Review code best practices.
Fleet Management Scenario
Create
a Class
Build Test
Set as
Input
Startup
Code
Object
Visual Studio Environment
Benefits of X++ Code and .NET CIL
CIL runs much faster in most scenarios. In cases where there are many method
calls, and a lot of algorithmic content (as opposed to database access), you can
expect significant performance improvements.
• It is easier to write application logic in other managed languages.
• Dynamics AX assemblies can be consumed directly.
• The preferred way of consuming business logic in Dynamics AX externally is by using services.
CIL can efficiently reference classes that are available in other .NET
assembly DLL files.
The standard
compilation unit for
X++ is the same as
for other .NET
languages such as C#.
Demonstration
• Create a Runnable Class (A Static Main Method)
Practice: Create a Runnable Class
Scenario:
For the fleet management scenario, in the X++ code review
we will need to create a static method in order to familiarize
ourselves with coding. Special attention in this module will
need to be given to the code editor, intellisense, syntax, and
code statements in order to complete future scenarios.
IntelliSense
Prompts the
Predictive Helps
user for Ensures that
typing tool of maintain Varies with
known items are
the elements consistent version of
methods and consistently
directly from spelling of Visual Studio
possible used
the AOT elements
choices
Demonstration
• Demo intellisense
Primitive Data Types
Anytype A placeholder for any data type.
Booleans Can only contain the values false and true.
Dates Contains day, month, and year.
Enums An abbreviation for enumerated text—a set of literals.
GUIDs A globally unique identifier.
A number without a decimal point. To declare an integer, use
Integers
the keyword int.
Reals Numbers with a decimal point; also called decimals.
A number of characters. To declare a string, use the keyword
Strings
str.
Contains hours, minutes, and seconds. To declare a time, use
TimeOfDay
the system type timeOfDay.
utcdatetime Contains year, month, day, hour, minute and second.
Composite Data Types
class DevBasicsEDTSample
{
public static void main(Args _args)
{
DBVehicleType vehicleType;
vehicleType = ‘Truck’;
info(vehicleType);
}
}
Variable Declaration
Operator Description
Assigns the expression on the right of
= the equal sign to the variable on the
left.
Assigns the variable on the left the
+= current variable value plus the
expression on the right.
++ Increments the variable by one.
Assigns the variable on the left the
-= current variable value minus the
expression on the right.
-- Decrements the variable by one.
Arithmetic Operators
Operator Term Description
Performs expression2 left shift (a multiplication by 2) on
<< Left shift
expression1.
>> Right shift Performs expression2 right shift (a division by 2) on expression1.
* Multiply Multiplies expression1 by expression2.
/ Divide Divides expression1 by expression2.
DIV Integer division Performs an integer division of expression1 by expression2.
Returns the remainder of an integer division of expression1 by
MOD Integer remainder
expression2.
~ Not Unary operator. Performs a binary not-operation.
& Binary AND Performs a binary and-operation on expression1 and expression2.
Performs a binary XOR-operation on expression1 and
^ Binary XOR
expression2.
| Binary OR Performs a binary or-operation on expression1 and expression2.
+ Plus Adds expression1 to expression2.
- Minus Subtracts expression2 from expression1.
Takes three expressions: expression1 ? expression2 : expression3.
? Ternary operator If expression1 is true, expression2 is returned; otherwise,
expression3 is returned.
Relational Operators
Operator Description
like Returns true if expression1 is like expression2.
! Not.
!= Inequality operator (not equal to).
# Prefix on macro names.
&& Logical AND.
|| Logical OR.
< Less than.
== Returns true if both expressions are equal.
> Greater than.
>= Greater than or equal.
Order of Operator Precedence
Create a
Create an
Create a Box Dialog
Info log
Button
Output Syntax
Box Info Log
info("Information notice to the
Box::info(“Body text”, “title”, interface");
“Help text”);
DialogButton dialogButton;
Switch
While
Do while
For
If..else and Switch Statements
int oilchange = 3;
int oilchange = 3;
str answer;
if(oilchange >=2)
switch(oilchange)
{
{
info("Repeat customer");
case 1:
}
answer = "First time customer";
break;
else
case 2:
{
answer = "Repeat customer";
info("New customer");
break;
}
default:
answer = "Frequent customer";
break;
}
info(strFmt(answer));
While and For
While Example For Example
int counter1 = 0; for (int counter2 = 0; counter2
!=4; counter2++)
while (counter1 != 4) {
{ info(strFmt("counter2 is %1",
info(int2Str(counter1)); counter2));
counter1++; }
}
Demonstration
• If…else and Switch statements using pervious
code.
Demonstration
• Demonstrate While:
int counter1 = 0;
while (counter1 != 4)
{
info(int2Str(counter1));
counter1++;
}
Demonstration
• For loop
Comparison Tools
Old
Original
Code
New
Import
Code
Merged
Results
Code
Debugger
Debugger
Debugger
Debugger
Best Practices
Naming Conventions
Code Placement
Comments
Create a Create an
Base Extended
Class
Build
Class
Class
Instance
Declaratio
Methods
n
Static Main
Methods Methods
Demonstration
• Demonstrate the Key Methods
Class Inheritance
Protecte
d
Private
Public
Module Review
Classes
Test Your Knowledge Question
1. Which type of class should be created in order to
test code?
a) Runnable class
b) A normal class
c) A static class
d) A public class
Test Your Knowledge Question
2. What is the reserved word in a function that is
used when the method does NOT return a value?
a) Static
b) Null
c) Void
d) Private
Test Your Knowledge Question
3. Which keyword is used in the class declaration to
specify class inheritance? This allows one “child”
class to inherit the methods and variables of
another “parent” class.
a) Inherits
b) Extends
c) Supports
d) Follows
Test Your Knowledge Question
4. TRUE or FALSE. Using the “Private” keyword for
variables or methods allows access to those
variables from within the current method as well as
subclasses.
a) True
b) False
Test Your Knowledge Question
5. TRUE or FALSE. If a child class inherits variables
and methods from a parent class, those methods
cannot be altered or changed in the child.
a) True
b) False
Module 14
Database Manipulation
Module Objectives
• Review data retrieval process.
• Demonstrate best practices when updating data.
• Explain the transaction integrity checking
system.
• Review how to update and delete data.
Fleet Management Scenario
View Build Test
Build
Update Delete
Test
Test Build
Fetching additional
Results of a select
records with the
statement are
“next” statement and
returned in a table
“while select”
buffer variable.
statements
Select Statement Syntax
SelectStatement = select Parameters
[ [ FindOptions ] [ FieldList
Parameters from ] ] TableBufferVariable [ IndexClause ] [ Options ] [ Whe
reClause ] [ JoinClause ]
CustTable custTable;
DirPartyTable dirPartyTable;
info(dirPartyTable.Name+', '+custTable.AccountNum);
}
Demonstration
• While Select Statement
Demonstration
• Show view records example
Reading Records TYKs
1. You are to complete the code needed to read
records. Which will best complete this statement.
While _________ fmVehicleMaint join fmVehicle
a) select for update
b) select
c) order by
d) select into
Reading Records TYKs
2. You need to find the equivalent value in the second table. Which will best
complete this statement.
where fmVehicle.dbVehicleID _________ fmVehicleMaint.dbVehicleID
a) =+
b) =
c) !=
d) ==
Reading Records TYKs
3. You need to output the code to the screen. Which will best complete this statement.
_________(Int2Str(fmVehicleMaint.dbVehicleID)+', '+fmVehicle.dbMake);
a) info::box
b) info
c) warning
d) print
Transaction Integrity Checking
ttscommit – Indicates
ttsabort – Used as an
the successful end of a
ttsbegin – Indicates the exception to abort and
transaction. This ensures
beginning of the roll back a transaction to
the transaction
transaction. the state before the
performed as intended
ttsbegin.
upon completion.
Data Insert
ttsBegin;
inventItemPriceToleranceGroup.itempricetolerancegroupid = '4%';
inventItemPriceToleranceGroup.name = 'TelevisionSeriesOne';
inventItemPriceToleranceGroup.insert();
inventItemPriceToleranceGroup.itempricetolerancegroupid = '6%';
inventItemPriceToleranceGroup.name = 'TelevisionSeriesTwo';
inventItemPriceToleranceGroup.insert();
ttsCommit;
info("Yahoo!");
Demonstration
• Insert Statements
Demonstration
• Insert Records into Fleet Management tables
Data Insert TYKs
4.You are to complete the code needed to insert records. You need to finish
the transaction. Which will best complete this statement.
{
ttsbegin;
~~~Body of code here~~~
_________________
}
a) ttsabort;
b) insert;
c) escape;
d) ttscommitt;
Data Insert TYKs
5. You are to complete the code needed to insert
records. You need to format the date. Which will
best complete this statement.
fmVehicle.dbYear = __________(01/01/2008);
a) datepart
b) Mkdate
c) sysdate
d) datename
Data Insert TYKs
6. You are to complete the code needed to insert
records. Which will best complete this statement.
fmVehicle.______________
a) insertrecord();
b) insertall();
c) insert();
d) insertnow():
Update
ttsBegin;
while select forupdate inventTable
exists join inventItemGroupItem
where InventItemGroupItem.ItemId == inventTable.ItemId
&& InventItemGroupItem.ItemGroupID == 'TV&Video'
{
inventTable.ItemPriceToleranceGroupId =“7%";
inventTable.update();
info("this works!");
}
ttsCommit;
Demonstration
• Update a record in the Vehicle table
Data Updates TYKs
7. You are to complete the code needed to update
records. Which will best complete this statement.
while select _______ fmVehicle
a) read
b) forupdate
c) lock
d) fetch only
Data Updates TYKs
8. You are to complete the code needed to update
records. You would like find the equivalent value.
Which will best complete this statement.
where fmVehicle.dbVehicleID ________ 1
a) ==
b) =
c) +=
d) !=
Data Updates TYKs
9. You are to complete the code needed to update records. You need to assign the value.
Which will best complete this statement.
{
fmVehicle.dbModel _______ "Yaris";
fmVehicle.update();
}
a) ==
b) =
c) +=
d) !=
Data Deletion
ttsBegin;
while select forupdate inventTable
exists join inventItemGroupItem
where InventItemGroupItem.ItemId == inventTable.ItemId
&& InventItemGroupItem.ItemGroupID == 'TV&Video'
{
inventTable.delete();
info("this works!");
}
ttsCommit;
Demonstration
• Delete Statement
Data Deletion TYKs
10. You are to complete the code needed to delete
records. Which will best complete this statement.
while select __________ fmVehicle
a) delete
b) fetch
c) lock
d) forupdate
Data Deletion TYKs
11. You are to complete the code needed to delete
specific records. Which will best complete this
statement.
_________ fmVehicle.dbVehicleID == 2
a) orderby
b) join
c) where
d) from
Data Deletion TYKs
12. You are to complete the code needed to delete records. Which will best complete this
statement.
{
fmVehicle.________();
}
a) drop
b) kill
c) deletefrom
d) delete
Module Review
Database Manipulation
Test Your Knowledge Question
You have tables named salesTable and salesLine.
The salesTable contains the following data: The salesLine table contains the following information:
SalesID RecID SalesID RecID
Create Catch
Errors Build
Class
Add Add
Try/Catch TTSBegin Test
Block TTSCommit
Exception Types
info: Displays deadlock: Informs the user
warning: Indicates the user error: Indicates a fatal
informational exceptions; that the system
has performed an illegal, error has occurred and the
for example, a certain encountered a deadlock
though nonfatal operation. transaction has stopped.
record has been updated. situation in the database.
UpdateConflictNotRecov
UpdateConflict: Indicates
CodeAccessSecurity: ered: Indicates that an
CLRError: Indicates that an that an error has occurred
Indicates that an error has error has occurred in a
error has occurred during in a transaction using
occurred during the use of transaction using
the use of the CLR Optimistic Concurrency
CodeAccessPermission.de Optimistic Concurrency
functionality. Control, and that the
mand. Control, and that the code
transaction will be retried.
will not be retried.
Key Commands
Try Catch
Finall
Retry
y
Code Statements – Part 1
class CustCreateCustomer
{
custCreateCustomer.run();
}
Code Statements – Part 2
public void run()
{
Dialog dlg = new Dialog("Create new customer");
DialogField dlgCust;
DialogField dlgGrp;
CustTable custTable;
dlgCust = dlg.addField(extendedTypeStr(CustVendAc), "Customer account");
dlgGrp = dlg.addField(extendedTypeStr(CustGroupId));
if (dlg.run())
{
try
{
custTable.AccountNum = dlgCust.value();
custTable.CustGroup = dlgGrp.value();
Code Statements – Part 3
if (!custTable.validateWrite())
{
throw error("Please enter all required fields.");
}
else
{
custTable.insert();
}
}
catch (Exception::Error)
{
error("An error occurred. Please try again");
}
Demonstration
• Invalid VIN: Error thrown.
Demonstration
• Validated VIN
Code Statements TYKs
1. You are to complete the code needed to start exception
handling. Which will best complete this statement.
____________________ error("Please enter a valid VIN
number.");
a) exception
b) catch
c) throw
d) info
Code Statements TYKs
2. You are to complete the code needed to catch
an exception. Which will best complete this
statement.
catch (_________________________)
a) exception::error
b) error
c) ttsAbort
d) dialog::error
Code Statements TYKs
3. You are to complete the code needed to execute
exception handling. You need to display this
message. Which will best complete this statement.
___________("An error occurred. Please try again");
a) info::exception
b) catch
c) error
d) dialog::error
Module Review
Exception Handling
Test Your Knowledge Question
1. The statements provided in the “finally” clause
are executed irrespective of whether the try block
threw any exceptions.
a) True
b) False
Test Your Knowledge Question
2. Which of the following is NOT a valid exception
type?
a) Info
b) Deadlock
c) Stop
d) UpdateConflict
Test Your Knowledge Question
3. TRUE OR FALSE. The “throw” statement initiates a
ttsAbort command.
a) True
b) False
Test Your Knowledge Question
4. You need to validate the date and throw an error if the date entered is null or greater than
current system date. Which of X++ statements should you use?
a) If(InputDate != datenull()) c) If(InputDate != datenull())
{ {
Throw error(“Wrong selection of date”); Throw error(“Wrong selection of date”);
} If(inputDate > systemDateGet())
Else If(inputDate > systemDateGet()) {
{ Throw error(“Wrong selection of
Throw error(“Wrong selection of date”); date”);
} }
}
1. Sign-in via AAD (can be multi-factor AuthN) 2. AAD redirects to ‘AX 7’ 3. ‘AX 7’ start page displayed
Authentication for Services
AX
App Server
AX web services (OAuth)
Security Structure in AX
Security Authorization and Access Control
Security Authorization and Access Control
Extensible Data Security Framework
Security Constrained
Query Context
Policy Tables
Role Design Principles
Role segregation
categories
Role types.
Needed Needed
Needs
Access Permissio
Record
Level n
Table Fields
Allow edit
Allow edit
on create
Minimum
Mandator
read
y
access
Form Fields
Allow Edit
Needed
Mandatory
Permission
Menu Items
Read Update
Permissions Permissions
Module Review
Security Basics
Test Your Knowledge Question
1. TRUE OR FALSE. All users must be assigned at
least one security role in order to access AX.
a) True
b) False
Test Your Knowledge Question
2. If the property value for the Needed Permission
property on a form control is set to “Create”, which
other permissions does this level allow?
a) It only allows create access.
b) It allows create and read access only.
c) It allows create, read, and update access.
d) It allows create and delete access.
Test Your Knowledge Question
3. TRUE or FALSE. Roles themselves are specific to a
company or organization.
a) True
b) False
Test Your Knowledge Question
4. Which of the following are examples of a
privilege? (Select the two that apply)
a) Being a system administrator
b) Canceling a payment
c) Managing system security
d) Processing deposits
Test Your Knowledge Question
5. Which two of the following choices can be
assigned to a role?
a) Privileges
b) Permissions
c) Configuration Keys
d) Duties
Module 17
Introduction to Advanced Topics
Module Objectives
• Review Business Intelligence features.
• Review reporting framework features.
• Explain services and integrations.
• Define and create Data Entities.
BI Features
Services
hosted in
Microsoft Simplified
Azure development
Compute
service
Simplified Enhanced
administration report viewing
Development Process
Create reporting project in Visual Studio
Built-in back-office
document
management
capabilities
Parameterized views
Precision documents
and drill-through
to comply with local
navigations to other
regulatory business
AX pages and other
practices.
reports.
Financial Reporting
22 default
financial
reports
Requires proper
privileges and
duties
Service and Integrations Overview
Open Data Protocol (Odata) V4
Provides a simple
and uniform way to Supports
share data in a Enables broad consumption in
discoverable integration across PowerBI.com as a
fashion. products. refreshable data
• Uniform URL source
conventions
Office Integration
Excel Data
Export to
Connector
Excel
app
Workflows
Consistent
processes
Centralized Process
work list visibility
About Data Entities
De-normalized
view of database
tables
Replace
Provides single
diverging
stack to capture
concepts of DIXF
business logic
entities
Provide primary
mechanism to
extract/insert
data sets
De-normalized View
Data Entity Categories
Parameter
Reference
Master
Document
Transaction
Data Entity Use Cases
Synchronous Asynchronou
services s integration
Data Business
migration Intelligence
Creating Data Entities