Beruflich Dokumente
Kultur Dokumente
Unless otherwise noted, the examples depicted herein are provided for illustration only and are fictitious. No
real association or connection is intended or should be inferred.
This courseware does not provide you with any legal rights to any intellectual property in any Microsoft
product. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the
rights under copyright, no part of this courseware may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means or for any purpose, without the express written
permission of Microsoft Corporation.
Microsoft®, Microsoft Dynamics®, Microsoft® PowerPoint®, Microsoft® SQL Server® data management
software and Microsoft Dynamics® NAV are trademarks of the Microsoft group of companies. All other
trademarks are property of their respective owners.
MICROSOFT LICENSE TERMS
MICROSOFT INSTRUCTOR-LED COURSEWARE
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its
affiliates) and you. Please read them. They apply to your use of the content accompanying this agreement which
includes the media on which you received it, if any. These license terms also apply to Trainer Content and any
updates and supplements for the Licensed Content unless other terms accompany those items. If so, those terms
apply.
BY ACCESSING, DOWNLOADING OR USING THE LICENSED CONTENT, YOU ACCEPT THESE TERMS.
IF YOU DO NOT ACCEPT THEM, DO NOT ACCESS, DOWNLOAD OR USE THE LICENSED CONTENT.
If you comply with these license terms, you have the rights below for each license you acquire.
1. DEFINITIONS.
a. “Authorized Learning Center” means a Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, or such other entity as Microsoft may designate from time to time.
b. “Authorized Training Session” means the instructor-led training class using Microsoft Instructor-Led
Courseware conducted by a Trainer at or through an Authorized Learning Center.
c. “Classroom Device” means one (1) dedicated, secure computer that an Authorized Learning Center owns
or controls that is located at an Authorized Learning Center’s training facilities that meets or exceeds the
hardware level specified for the particular Microsoft Instructor-Led Courseware.
d. “End User” means an individual who is (i) duly enrolled in and attending an Authorized Training Session
or Private Training Session, (ii) an employee of a MPN Member, or (iii) a Microsoft full-time employee.
e. “Licensed Content” means the content accompanying this agreement which may include the Microsoft
Instructor-Led Courseware or Trainer Content.
f. “Microsoft Certified Trainer” or “MCT” means an individual who is (i) engaged to teach a training session
to End Users on behalf of an Authorized Learning Center or MPN Member, and (ii) currently certified as a
Microsoft Certified Trainer under the Microsoft Certification Program.
g. “Microsoft Instructor-Led Courseware” means the Microsoft-branded instructor-led training course that
educates IT professionals and developers on Microsoft technologies. A Microsoft Instructor-Led
Courseware title may be branded as MOC, Microsoft Dynamics or Microsoft Business Group courseware.
h. “Microsoft IT Academy Program Member” means an active member of the Microsoft IT Academy
Program.
i. “Microsoft Learning Competency Member” means an active member of the Microsoft Partner Network
program in good standing that currently holds the Learning Competency status.
j. “MOC” means the “Official Microsoft Learning Product” instructor-led courseware known as Microsoft
Official Course that educates IT professionals and developers on Microsoft technologies.
k. “MPN Member” means an active silver or gold-level Microsoft Partner Network program member in good
standing.
l. “Personal Device” means one (1) personal computer, device, workstation or other digital electronic device
that you personally own or control that meets or exceeds the hardware level specified for the particular
Microsoft Instructor-Led Courseware.
m. “Private Training Session” means the instructor-led training classes provided by MPN Members for
corporate customers to teach a predefined learning objective using Microsoft Instructor-Led Courseware.
These classes are not advertised or promoted to the general public and class attendance is restricted to
individuals employed by or contracted by the corporate customer.
n. “Trainer” means (i) an academically accredited educator engaged by a Microsoft IT Academy Program
Member to teach an Authorized Training Session, and/or (ii) a MCT.
o. “Trainer Content” means the trainer version of the Microsoft Instructor-Led Courseware and additional
supplemental content designated solely for Trainers’ use to teach a training session using the Microsoft
Instructor-Led Courseware. Trainer Content may include Microsoft PowerPoint presentations, trainer
preparation guide, train the trainer materials, Microsoft One Note packs, classroom setup guide and Pre-
release course feedback form. To clarify, Trainer Content does not include any software, virtual hard
disks or virtual machines.
2. USE RIGHTS. The Licensed Content is licensed not sold. The Licensed Content is licensed on a one copy
per user basis, such that you must acquire a license for each individual that accesses or uses the Licensed
Content.
2.1 Below are five separate sets of use rights. Only one set of rights apply to you.
2.2 Separation of Components. The Licensed Content is licensed as a single unit and you may not
separate their components and install them on different devices.
2.3 Redistribution of Licensed Content. Except as expressly provided in the use rights above, you may
not distribute any Licensed Content or any portion thereof (including any permitted modifications) to any
third parties without the express written permission of Microsoft.
2.4 Third Party Programs and Services. The Licensed Content may contain third party programs or
services. These license terms will apply to your use of those third party programs or services, unless other
terms accompany those programs and services.
2.5 Additional Terms. Some Licensed Content may contain components with additional terms,
conditions, and licenses regarding its use. Any non-conflicting terms in those conditions and licenses also
apply to your use of that respective component and supplements the terms described in this agreement.
a. Pre-Release Licensed Content. This Licensed Content subject matter is on the Pre-release version of
the Microsoft technology. The technology may not work the way a final version of the technology will
and we may change the technology for the final version. We also may not release a final version.
Licensed Content based on the final version of the technology may not contain the same information as
the Licensed Content based on the Pre-release version. Microsoft is under no obligation to provide you
with any further content, including any Licensed Content based on the final version of the technology.
b. Feedback. If you agree to give feedback about the Licensed Content to Microsoft, either directly or
through its third party designee, you give to Microsoft without charge, the right to use, share and
commercialize your feedback in any way and for any purpose. You also give to third parties, without
charge, any patent rights needed for their products, technologies and services to use or interface with
any specific parts of a Microsoft software, Microsoft product, or service that includes the feedback. You
will not give feedback that is subject to a license that requires Microsoft to license its software,
technologies, or products to third parties because we include your feedback in them. These rights
survive this agreement.
c. Pre-release Term. If you are an Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, MPN Member or Trainer, you will cease using all copies of the Licensed Content on
the Pre-release technology upon (i) the date which Microsoft informs you is the end date for using the
Licensed Content on the Pre-release technology, or (ii) sixty (60) days after the commercial release of the
technology that is the subject of the Licensed Content, whichever is earliest (“Pre-release term”).
Upon expiration or termination of the Pre-release term, you will irretrievably delete and destroy all copies
of the Licensed Content in your possession or under your control.
4. SCOPE OF LICENSE. The Licensed Content is licensed, not sold. This agreement only gives you some
rights to use the Licensed Content. Microsoft reserves all other rights. Unless applicable law gives you more
rights despite this limitation, you may use the Licensed Content only as expressly permitted in this
agreement. In doing so, you must comply with any technical limitations in the Licensed Content that only
allows you to use it in certain ways. Except as expressly permitted in this agreement, you may not:
access or allow any individual to access the Licensed Content if they have not acquired a valid license
for the Licensed Content,
alter, remove or obscure any copyright or other protective notices (including watermarks), branding
or identifications contained in the Licensed Content,
modify or create a derivative work of any Licensed Content,
publicly display, or make the Licensed Content available for others to access or use,
copy, print, install, sell, publish, transmit, lend, adapt, reuse, link to or post, make available or
distribute the Licensed Content to any third party,
work around any technical limitations in the Licensed Content, or
reverse engineer, decompile, remove or otherwise thwart any protections or disassemble the
Licensed Content except and only to the extent that applicable law expressly permits, despite this
limitation.
5. RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not expressly granted to
you in this agreement. The Licensed Content is protected by copyright and other intellectual property laws
and treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in the
Licensed Content.
6. EXPORT RESTRICTIONS. The Licensed Content is subject to United States export laws and regulations.
You must comply with all domestic and international export laws and regulations that apply to the Licensed
Content. These laws include restrictions on destinations, end users and end use. For additional information,
see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because the Licensed Content is “as is”, we may not provide support services for it.
8. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this agreement if you fail
to comply with the terms and conditions of this agreement. Upon termination of this agreement for any
reason, you will immediately stop all use of and delete and destroy all copies of the Licensed Content in
your possession or under your control.
9. LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the Licensed
Content. The third party sites are not under the control of Microsoft, and Microsoft is not responsible for
the contents of any third party sites, any links contained in third party sites, or any changes or updates to
third party sites. Microsoft is not responsible for webcasting or any other form of transmission received
from any third party sites. Microsoft is providing these links to third party sites to you only as a
convenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third party
site.
10. ENTIRE AGREEMENT. This agreement, and any additional terms for the Trainer Content, updates and
supplements are the entire agreement for the Licensed Content, updates and supplements.
12. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws
of your country. You may also have rights with respect to the party from whom you acquired the Licensed
Content. This agreement does not change your rights under the laws of your country if the laws of your
country do not permit it to do so.
13. DISCLAIMER OF WARRANTY. THE LICENSED CONTENT IS LICENSED "AS-IS" AND "AS
AVAILABLE." YOU BEAR THE RISK OF USING IT. MICROSOFT AND ITS RESPECTIVE
AFFILIATES GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. YOU MAY
HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT
CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT AND
ITS RESPECTIVE AFFILIATES EXCLUDES ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM
MICROSOFT, ITS RESPECTIVE AFFILIATES AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP
TO US$5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL,
LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The
above limitation or exclusion may not apply to you because your country may not allow the exclusion or
limitation of incidental, consequential or other damages.
Please note: As this Licensed Content is distributed in Quebec, Canada, some of the clauses in this
agreement are provided below in French.
Remarque : Ce le contenu sous licence étant distribué au Québec, Canada, certaines des clauses
dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le contenu sous licence visé par une licence est offert « tel quel ». Toute
utilisation de ce contenu sous licence est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie
expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection dues
consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties
implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits
prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre
pays si celles-ci ne le permettent pas.
Module Overview
Microsoft Dynamics AX 2012 R3 for Retail supports multiple retail channels. Retail
channels include online stores, online marketplaces, and brick-and-mortar stores.
In Retail, a brick-and-mortar store is called a “retail store.”
Objectives
Introduction
Course objectives
Prerequisites
Technical overview
INTRODUCTION
Training is an important component of maintaining the value of a Microsoft
Dynamics® investment. Quality training from industry experts keeps you up-to-
date and helps you develop the skills necessary for fully maximizing the value of
your solution. Microsoft Dynamics provides different kinds of training to meet
everyone’s needs, from online training, classroom training, or training materials.
Select the training type that will best help you stay ahead of the competition.
Online Training
Online training delivers convenient, detailed training in the comfort of your own
home or office. Online training provides immediate access to training 24 hours a
/*day. It is perfect for the customer who does not have the time or budget to
travel. Online training options combine the efficiency of online training with the
thorough product coverage of classroom training.
Classroom Training
Training materials help you learn at your own pace, in your own time, with
information-packed training manuals. The many training manuals features many
tips, tricks, and insights that you can reference continuously.
The Microsoft Dynamics courseware consists of detailed training manuals that are
designed from a training perspective. These manuals include advanced topics, in
addition to training objectives, exercises, interactions, and quizzes.
Look for a complete list of manuals that are available for purchase on
CustomerSource or PartnerSource.
Lab
Within the Microsoft Dynamics training materials, you will find labs. These labs are
typically offered in two levels to accommodate each student’s variety of
knowledge and expertise. We suggest that you try the High level steps first. If you
need help completing the task, look to the information in the Detailed steps.
Detailed steps
Detailed steps are geared toward new users who require detailed instructions and
explanations to complete the lab. Detailed steps guide you through the whole
task. This includes navigation.
Student Objectives
What do you hope to learn by participating in this course?
1.
2.
3.
Course Objectives
The main objective of this course on Microsoft Dynamics AX 2012 R3 for Retail in Brick and Mortar Stores
Customization and Extensibility is to understand the following:
Microsoft Dynamics AX for Retail POS is the point of sale (POS) program for
Microsoft Dynamics AX.
A Retail Brick and Mortar Store implementing AX 2012 R3 can use two types of
POS
Retail POS - Fixed POS Terminal that uses a Windows Forms based touch
User Interface (UI).
Modern POS - Windows 8 based POS that is created by using HTML5
development.
Tasks are performed by using a POS register and the graphical UI. Both are easy
to use and can be set up to meet the requirements of many industries, such as
grocery, fashion and specialty retailers.
Lesson Objectives
Retail POS has a dynamic interface that can be configured and customized for
your type of business and store procedures. Additionally, Retail POS can work
offline. This helps make sure that your stores remain fully operational during
network interruptions. All data is automatically updated when the connection is
restored.
Modern POS
The Modern POS app running on a device is a thin client. It must connect to
Microsoft Dynamics AX Retail Server. Retail Server performs the business logic and
processing for Modern POS.
Modern POS is a smaller POS installation that is primarily designed for Windows 8.
Modern POS mostly uses Retail Server for the Master data and RTS for calls.
Microsoft Dynamics POS interacts with the following retail components to perform
end-to-end operations:
Synch service is the integrated service that periodically sends data between the
headquarters office and the store database. Communications that use sync service
are managed through distribution locations and Retail Scheduler in Retail
Headquarters (HQ).
Together with Async Server and Retail Scheduler, real-time service completes the
communications mechanism of Microsoft Dynamics AX for Retail. Real time
service provides real-time, synchronous communication between POS registers
and Microsoft Dynamics AX. It can be used to authenticate cashier logon
credentials, send loyalty requests, and exchange “up-to-the-minute” physical
inventory information between the headquarters office and the stores, and more.
Channel Database
Each store must have its’ own database, and a single database is used for multiple
registers, this is known as the channel Database. This helps make sure that the
same master data is available to all POS registers in the store.
Offline Database
You can also create an offline databases on POS computers. An offline database
helps make sure that the store’s operations can continue even if the connection to
the shared database server is lost. If the connection to the shared database server
is lost, the POS computers switch to offline databases. The shared database and
the offline databases are kept in sync by using Microsoft Sync framework.
The store and the offline database can be set up by using the create database
utility.
Module Review
Module Review and Takeaways
4. Describe any two operations that cannot be performed when the POS store
database is offline.
Test Your Knowledge Solutions
MODEL ANSWER:
7. Each store must have its’ own database, and a single database is used
for multiple registers, this is known as the channel Database.
8. An offline database helps make sure that the store’s operations can
continue even if the connection to the shared database server is lost.
If the connection to the shared database server is lost, the POS
computers switch to offline databases.
9. No. Only the store database can be shared across multiple terminals.
10. Close a shift and print a Z-report.
MODULE 2: RETAIL POS EXTENSIBILITY TECHNICAL
OVERVIEW
Overview
This module discusses the Microsoft Dynamics AX 2012 POS extensibility and its
operations. This includes information on the following:
Retail POS
Modern POS (MPOS)
Note: The Retail Modern POS is comprised of pre-release components. All pre-
release features and functionality are preliminary based on current expectations,
and are subject to change without notice.
Objectives
Describe the technical framework and capabilities of Retail POS and Modern POS.
Retail POS
Capabilities
Microsoft Dynamics AX for Retail POS is the point of sale (POS) program for Retail.
You can use Retail POS to perform the following tasks:
Process sales
Operate the cash drawer
Scan bar codes
Print customer receipts
Calculate the sales total
Calculate tax
Calculate the change that is due back from the amount that is paid
Issue product refunds
Suspend transactions
Process customer loyalty transactions
Issue credit memos
Issue gift cards
Scan bar codes
Receive payments
Print receipts
Create and track customer orders
Process debit cards and credit cards
Check inventory, plus many more.
When the store database is offline, the following operations cannot be performed:
a. Inventory Lookup
b. Gift Card Operations
c. Loyalty Operations
d. Customer Order Operations, plus more
Microsoft Dynamics AX for Retail POS is a fully customizable point of sale (POS)
component of Microsoft Dynamics AX 2012 for Retail. You can use Retail POS to
process sales, operate the cash drawer, and scan bar codes or print customer
receipts, among other business tasks.
Lesson Objectives
POS Extension
To customize business logic in Retail POS, you must install the Retail Software
Development Kit (SDK). The SDK is included with Microsoft Dynamics AX 2012,
and includes the following folders:
POS Plug-ins – Contains code that you use to extend and customize
Retail POS. For more information about how to install Retail POS
Plug-ins, refer to Install Retail SDK (http://technet.microsoft.com/en-
us/library/hh771575.aspx )
Commerce Runtime – Contains services that you use to extend and
customize the online store for Microsoft Dynamics AX 2012 for Retail.
The details of this are not explained in this course.
POS Clients – Contains the code for the Windows Modern Point of
Sale Application and Windows Phone Point of Sale Application,
together with native code for Peripherals.
Hardware Station – Contains the code for Hardware Station service
that enables you to customize the possibilities of the hardware
station.
Online Channel – Contains the code that you can use to extend the
data flow between online retail channels like e-commerce.
Retail POS Plug-ins contains a set of services and application triggers. Most of the
functionality in Retail POS is implemented by using services. For example, you use
the Customer service for tracking, adding or deleting customers from the Retail
POS register.
These services are a collection of the .NET Framework assemblies that implement
public interfaces. Refer to the POS Extensibility Interface Definition course
document for more information.
Retail POS loads the services at run time and invokes their functionality through
these interfaces. Because Retail POS Plug-ins is included with the C# source code
for these assemblies, you can customize or replace services and triggers to extend
features in Retail POS, such as calculating taxes.
The folder contains two Visual Studio solutions—one for services and the other for
triggers. Triggers are used to insert custom code before or after Retail POS
operations, such as issuing a gift certificate, a customer add, a clear, or a payment,
and more. For example: Before you issue a gift card, if you want to do a validation
such as whether the customer is eligible to issue a gift card, you can perform the
validation here.
Operations
Services
Triggers
Commerce Data Exchange: Real-time Service
Operations
Services
Services include one or more operations and implement a single, unique interface.
You can make partial modifications to an existing service and continue to use the
remaining functionality. Or, you can replace the complete service assembly with
your own custom code. For more information about how to implement services,
refer to “How to modify a Form” at http://technet.microsoft.com/en-
us/library/jj937978.aspx
Features in the Retail POS are services that interact with the program through
interfaces. Services include one or more operations and implement a single,
unique interface. Each service implements an interface. The developer can make
partial or full modifications to the service’s project. Microsoft Dynamics AX 2012 is
sent out with a collection of core services that can be customized or replaced by
using Retail POS Plug-ins. For descriptions of all the services interfaces that are
available in Retail POS, refer to “Interfaces for Services."(
http://msdn.microsoft.com/en-
us/library/microsoft.dynamics.retail.pos.contracts.services.aspx )
Triggers
Triggers are events that are raised by Retail POS that you can use to insert custom
code before or after operations. There are two types of triggers:
Pre-triggers
Post-triggers
Similar to services, triggers also implement unique interfaces. The developer can
use triggers to perform pre-validations and post validations. Each trigger interface
has a set of methods that can be extended by the developers for customization.
Pre-triggers provide another layer of verification and can return false if the
operation should be canceled. Post-triggers let you respond to an operation after
it is finished. Triggers can be extended in the same manner as services. For
descriptions of all the triggers interfaces that are available in Retail POS, refer to
“Interfaces for Triggers”.( http://msdn.microsoft.com/en-
us/library/microsoft.dynamics.retail.pos.contracts.triggers.aspx )
Technical Background of Retail POS
Retail POS is a Windows Forms based solution that is designed to include
extensibility. It uses the Microsoft MEF framework to manage dependency
injection and provide Inversion of control through which extensibility is
performed.
Retail POS uses Microsoft Synch framework for Synching Offline Database and
Channel Database.
Development Requirements
Some development requirements for Retail POS include the following:
Modern POS
Capabilities
Supports most of the capabilities that are provided by Retail POS except
for the limitations of hardware capabilities to interact with Windows 8
Framework.
There is no offline capability and uses RTS for order creation.
Supports the hardware station feature that can be used to remote print
and uses hardware that is not attached directly to the POS computer.
Framework and Extensibility
Source Code
Unlike Retail POS, the complete Source code for Modern POS is available with
Retail SDK. This lets you customize Modern POS.
Open Framework
Modern POS uses the Rest API that is provided by Retail Server and
also the data that is received is in the ODATA format that is a
Universal Format that is used by Microsoft and other third-party
software vendors. More information about ODATA can be found at
http://www.odata.org/.
The Rest API is fast becoming the most used standard for the
communication between the Server and clients. The Retail server
component uses these universally accepted components and this
helps make the customization easier.
Figure 2-2 : Technical Overview of Retail POS
Development Requirements
Lesson Objectives
Retail POS uses real-time service calls to start the Retail POS functionality, such as
Issue Gift Card or Create Customer. You can create custom, real-time service
functionality in Retail Headquarters and call the functionality from Retail POS.
Module Review
Module Review and Takeaways
Tools
Module Overview
This module describes how to extend and customize the Retail POS on Microsoft Dynamics AX 2012 R3.
This lesson describes how to change Microsoft Dynamics AX for Retail POS registers by
creating new Retail POS skins. To create or modify existing Retail POS skins, you must
obtain a license from DevExpress. Retail POS uses DXExperience Winforms that are created
by DevExpress. Although you can develop your own forms without using DevExpress, we
recommend that you use these forms for consistency.
Lesson Objectives
03 - 2
Module 3: Development and Customization of Retail POS
POS Skins
Create a New Skin
03 - 3
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
To set the color properties on the new skin, follow these steps.
03 - 4
Module 3: Development and Customization of Retail POS
03 - 5
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
For Retail POS to install the new skin, you must put the skin assembly in the Retail
POS runtime folder. Copy the MyFirstCustomSkin.dll to the Skins folder in the
Retail POS runtime directory.
You must also make Retail POS aware of the new skin.
2. Right-click Theme on the drop-down menu, and then click View Details.
3. Click the New button, and then set the Retail POS skin name field to
MyFirstCustomSkin.
4. Close the Retail POS skins form, and then with the Retail POS visual
profiles form open, set Theme on the drop-down menu to
MyFirstCustomSkin.
5. Close the Retail POS visual profiles form.
03 - 6
Module 3: Development and Customization of Retail POS
7. Start Retail POS and the new skin’s visualization effects should display similar
to the following image.
03 - 7
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
User-Interface Extensibility
User-Interface Extensibility Overview
Microsoft Dynamics AX for Retail POS introduces a new way to customize forms by using
the Interaction service. Multiple developers can use this service to customize one or more
forms in one service. If there are multiple customizations, the Interaction service installs
only the first customization it finds for a form. This module also explains how to customize
forms that are not part of the Interaction services.
03 - 8
Module 3: Development and Customization of Retail POS
This lesson explains how to modify the Microsoft Dynamics AX 2012 R3 Retail POS
forms in Interaction service and other services forms.
Lesson Objectives
Explain how to customize forms in POS Plugins without having to use the
InteractionDefault service.
Forms that use this new pattern are included in the InteractionDefaults service.
The list is located at ‘\services\InteractionDefault\winformstouch.’
03 - 9
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
1. In the folder where you installed the Retail POS SDK, open the
Microsoft Dynamics AX for Retail POS Plug-ins folder.
2. Open the Services folder and double-click the Services Visual Studio
solution file.
In this step, you override the LogOnForm form. This form has a
dependency on the ManagerAccessForm.
03 - 10
Module 3: Development and Customization of Retail POS
How to Modify a Form in the Microsoft Dynamics Ax 2012 R2/R3 POS Item
Search Form
This topic explains how to add a new column to the existing Item search form
and view that form in the POS UI. For example, you will add the column
SerachName of the Item in the Item search form. You will fetch this column value
from the ECORESPRODUCT table.
03 - 11
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
1. By default, in the folder where you installed the Retail POS Software
Development Kit (SDK), it will be located at C:\Users\...\Documents\Retail
SDK\POS Plug-ins.
2. Open the Microsoft Dynamics AX for Retail POS Plug-ins folder. For more
information about how to install the Retail SDK, refer to the Installation guide.
3. Open the Services folder, and then double-click the Visual Studio solution
file, services.sln.
4. Open the Services folder, and then double-click the Services Visual Studio
solution file.
5. Click the Dialog project, and then expand the WinFormsTouch Folder. Click
frmItemSearch.cs and select view code. To modify the forms, you must have
a DevExpres license.
6. Add the following code in the variable declaration section of the
frmItemSearch class to declare the new column.
8. You must add the column in the gridView to appear in the form. For this
include the new column in the range and set the column properties in
InitializeComponent() method.
this.grdView.Columns.AddRange(new
DevExpress.XtraGrid.Columns.GridColumn[] {
this.colItemName,
this.colItemId,
this.colSearchString,
this.colItemPrice,
this.colItemUnitOfMeasure,
this.colItemTaxRate,
this.colItemOwnThirdProduc,
this.colItemRoundTrunc});
//
// colSearchString
//
this.colSearchString.Caption = "Search name";
this.colSearchString.FieldName = "SEARCHNAME";
this.colSearchString.Name = "colSearchString";
this.colSearchString.OptionsColumn.AllowSort =
DevExpress.Utils.DefaultBoolean.False;
this.colSearchString.SortMode =
DevExpress.XtraGrid.ColumnSortMode.Custom;
this.colSearchString.Visible = true;
this.colSearchString.VisibleIndex = 0;
this.colSearchString.Width = 161;
03 - 12
Module 3: Development and Customization of Retail POS
9. Now, modify the Item Search query to include the new column in the search
criteria so that you can filter and display in the GetItemList() method.
string query = string.Format("SELECT ITEMID, ITEMNAME, '' AS
ITEMPRICE,I.SEARCHNAME, I.UNITOFMEASURE, I.INVENTPRODUCTTYPE_BR " +
"FROM ( " +
" SELECT IT.INVENTPRODUCTTYPE_BR, IT.ITEMID,
COALESCE(TR.NAME, IT.ITEMNAME, IT.ITEMID) AS ITEMNAME, IT.DATAAREAID,
ISNULL(IM.UNITID, '') AS UNITOFMEASURE, ROW_NUMBER() " +
" OVER (ORDER BY IT.{0} {1}) AS ROW " +
" FROM ASSORTEDINVENTITEMS IT " +
" JOIN INVENTTABLEMODULE IM ON IT.ITEMID =
IM.ITEMID AND IM.MODULETYPE = 2 " +
" JOIN ECORESPRODUCT AS PR ON PR.RECID =
IT.PRODUCT " +
" LEFT JOIN ECORESPRODUCTTRANSLATION AS TR
ON PR.RECID = TR.PRODUCT AND TR.LANGUAGEID = @CULTUREID " +
" WHERE IT.STORERECID = @STORERECID {2}) I "
+
"WHERE I.DATAAREAID=@DATAAREAID AND I.ROW >
@FROMROW AND I.ROW <= @TOROW ", sortBy, asc, search);
10. Build the project in release mode and replace the Dialog.dll in the Retail
POS\Services\Extension folder. This path is applicable only for Microsoft
Dynamics AX 2012 R2. For later versions use POS\Extensions.
11. Start the POS, and then click the Product search button that is added in the
POS layout. The Item search form should resemble the following form:
03 - 13
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
03 - 14
Module 3: Development and Customization of Retail POS
Trigger Extensibility
Trigger Extensibility Overview
Triggers are used to capture events that start before and after Microsoft Dynamics
AX for Retail POS operations. You can insert custom logic before the operation
runs or after it is completed. The Retail POS IOperationTriggers interface
introduces new generic triggers called the PreProcessOperation and
PostProcessOperation.
Lesson Objectives
03 - 15
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
This lesson explains how to modify the triggers. To extend the triggers, you will
use the operation triggers as an example and then customize these triggers. You
will update the GiftCardBalance operation by asking the customer if he or she
wants to add his or her balance after it is verified.
1. Back up the existing assembly before any modification. If you must revert for
any reason, the original assemblies will be available in such scenarios.
2. Browse to the folder where the Retail POS Software Development Kit (SDK) is
installed. By default, it will be located at C:\Users\...\Documents\Retail
SDK\POS Plug-ins\.
3. Open the Triggers folder, and then double-click the Triggers Visual Studio
solution file.
4. Add a reference to the following assemblies that are located in the Retail POS
runtime folder:
o DevExpress.Utils.v11.2.dll
o POSProcesses.dll
o System.Windows.Forms.dll
LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(form);
if (form.DialogResult == DialogResult.OK)
{
//reference existing or new logic for adding money
to customer gift cards
}
}
}
03 - 16
Module 3: Development and Customization of Retail POS
else
{
LSRetailPosis.ApplicationLog.Log("IOperationTriggersV1.PostProcessOperatio
n", "After the operation has been processed this trigger is called.",
LSRetailPosis.LogTraceLevel.Trace);
}
}
8. After you build the project, put the assembly in the Retail
POS\Services\Extensions folder. This path applies only to Microsoft Dynamics
AX 2012 R2. For later versions, use POS\Extensions.
9. Start the POS runtime and perform the Gift card balance operation.
10. After you receive the balance, the dialog box appears with the customer
message that is written in the post process.
03 - 17
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Services Extensibility
Services Extensibility Overview
Lesson Objectives
03 - 18
Module 3: Development and Customization of Retail POS
Services include one or more operations and implement a single, unique interface.
You can change an existing service and continue to use the remaining
functionality.
Lesson Objectives
If, in the Z-report, you want to print the count of a returned transaction in the
shift, follow these steps.
1. Before the modification, take the backup of the existing assembly so that the
original assemblies will then remain available if you must revert to them.
2. Browse to the folder where you installed the Retail POS Software
Development Kit (SDK). By default, this folder will be located at
C:\Users\...\Documents\Retail SDK\POS Plug-ins\.
3. Open the Services folder, and then double-click the Services Visual Studio
solution file.
4. Browse to the EOD project, and then double-click the BatchPrinting.cs file
and add the following new method:
public static int CalculateReturnransactionCount(Batch batch)
{
int count = 0;
DbConnection connection =
ApplicationSettings.Database.LocalConnection;
if (connection.State != ConnectionState.Open)
connection.Open();
string query = "SELECT COUNT(S.TRANSACTIONID) FROM
RETAILTRANSACTIONTABLE H INNER JOIN RETAILTRANSACTIONSALESTRANS S ON " +
"H.TRANSACTIONID = S.TRANSACTIONID AND
H.STORE = S.STORE AND H.TERMINAL = S.TERMINALID AND H.DATAAREAID =
S.DATAAREAID " +
"WHERE H.STORE = @STOREID " +
"AND H.BATCHTERMINALID =
@BATCHTERMINALID " +
"AND H.DATAAREAID = @DATAAREAID " +
"AND H.BATCHID = @BATCHID " +
"AND S.QTY > 0";
using (DbCommand dBCommand = new SqlCommand())
{
dBCommand.Connection = connection;
dBCommand.CommandText = query;
dBCommand.Parameters.Clear();
if (batch != null)
{
dBCommand.Parameters.Add(new
03 - 19
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
SqlParameter("@STOREID", batch.StoreId));
dBCommand.Parameters.Add(new
SqlParameter("@BATCHTERMINALID", batch.TerminalId));
dBCommand.Parameters.Add(new
SqlParameter("@BATCHID", batch.BatchId));
dBCommand.Parameters.Add(new
SqlParameter("@DATAAREAID", ApplicationSettings.Database.DATAAREAID));
}
count = DBUtil.ToInt32(dBCommand.ExecuteScalar());
return count;
}
5. Locate the Print method (this Batch batch, ReportType reportType) in the
BatchPrinting.cs file and then add the following line of code after the line
reportLayout.PrepareHeader(batch, reportType);
reportLayout.AppendLine(string.Format("Return count-
{0}",CalculateNegativeTransaction(batch)));
6. After you do this, build the project and put the assembly in the Retail
POS\Services\Extensions folder. This path applies only to Microsoft Dynamics
AX 2012 R2. For later versions, use POS\Extensions.
7. Start the POS runtime and perform the Z-report operation to view the
changes in the report.
03 - 20
Module 3: Development and Customization of Retail POS
You can use Blank Operations to extend Microsoft Dynamics AX for Retail Point-of-Sale
(POS) by adding custom logic to the Retail POS register buttons. In the Retail POS
register design layout, you can add many blank operation buttons and specify the
operations information for each button. Later in this module, you will learn how to add a
blank operation and specify the operation information.
Lesson Objectives
03 - 21
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
This lesson explains how to set up a blank operation and add custom logic to the
blank operation
To set up a blank operation on the Retail POS register, follow these steps.
1. Start Retail POS. Right-click the Cashier Tasks button, and then select Button
Properties. The Configure button form opens.
2. In the Action drop-down menu, select Blank Operation. The Operation
number field is a string value that Retail POS uses to identify the Blank
Operation. Because you can send multiple blank operations to Retail POS at
the same time, you must give each blank operation a unique identity so that
Retail POS can distinguish which blank operation to execute.
You can use the Blank Operation param field to send an optional string
parameter. The Operation number and Blank Operation param values combine to
form the method signature of the Blank Operation. In this scenario, set the
Operation number to MyTask and leave the Blank Operation param value to My
Param.
3. You can use the fields in the Appearance tab on the right-side of the
Configure button form to customize the appearance of the button. For
example, you can set the text value that displays on the button when Retail
POS is started. Change the button name to MyOperation, as shown in the
following image:
03 - 22
Module 3: Development and Customization of Retail POS
1. Browse to the folder where you installed the Retail POS Software
Development Kit (SDK). By default, the folder will be located at
C:\Users\...\Documents\Retail SDK\POS Plug-ins\.
2. Open the Services folder, and then double-click the Services Visual Studio
solution file.
3. Browse to the Blank Operations project and expand it.
4. Right-click the reference node and then click Add reference and browse for
the assemblies POSProcessess in the Retail POS folder and then select it, and
then click OK.
5. Open the BlankOperation.cs file and find the BlankOperation method, as
shown in the following C# code example:
public void BlankOperation(IBlankOperationInfo operationInfo,
IPosTransaction posTransaction)
The posTransaction object contains all the information about the current
transaction.
Several Blank Operations can be handled in the one BlankOperation method. Use
a C# Switch statement on the operationInfo.OperationId value to capture the
specific Blank Operation that you must have. You can do this by adding the
following code to the BlankOperation method.
LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSStatusPanelText("My task
operation is clicked");
operationInfo.OperationHandled = true;
break;
}
03 - 23
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
8. Click the Cashier Tasks button, and then click the MyOperation button. You
will receive the following message in the status panel:
Lesson Objectives
03 - 24
Module 3: Development and Customization of Retail POS
This lesson explains how to add fields to the receipt. You will learn how to add a
line item field that shows the time that the item is added to a transaction and a
header field that shows the total quantity of the whole transaction.
Any fields that are created in custom fields are available in all three sections of the
receipt format designer—Header, Lines, and Footer. The Caption text ID is a
unique identifier for the text that will show in the receipt format designer (unlike
the custom fields for till layout that use the Name in the designer, and the Caption
text ID in the POS). The Caption text ID is still stored in the RetailLanguageText
table and is only used at Headquarters.
To add the custom fields to the Receipt Layout, follow these steps.
After the fields are created they can immediately be added to any receipt format.
2. Browse to Retail > Setup > POS > Receipt formats, and then click the
Designer button for any receipt format.
03 - 25
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
If the fields and labels are created correctly, you should be able to find the fields
and labels in the field list for any of the three sections.
03 - 26
Module 3: Development and Customization of Retail POS
Note: You did not correctly create the RetailLanguageText record, if something
appears that resembles (22000)??Missing String??.
3. Find a place to drag the Total Quantity field and the Time Scanned field to
the header section and give each field a hard-coded text label. Make sure
that you press the Save button when you are finished.
03 - 27
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
1. Before the modification, take the backup of the existing assembly so that the
original assemblies remain available if you must revert to the original
assemblies.
2. Browse to the folder where you installed the Retail POS Software
Development Kit (SDK). By default, it will be located at
C:\Users\...\Documents\Retail SDK\POS Plug-ins\.
3. Open the Services folder, and then double-click the Services Visual Studio
solution file.
4. Locate the FormModulation.cs file in the Printing service. Values for the
header field and the footer field are handled in the
GetInfoFromTransaction() method and for lines it is the
GetInfoFromSaleLineItem() method. Locate the switch statement for
GetInfoFromTransaction() from the following code example.
switch (itemInfo.Variable.ToUpperInvariant().Replace(" ", string.Empty))
{
case "DATE":
return
((IPosTransactionV1)theTransaction).BeginDateTime.ToShortDateString();
case "TIME24H":
return
((IPosTransactionV1)theTransaction).BeginDateTime.ToString("HH:mm");
03 - 28
Module 3: Development and Customization of Retail POS
5. To print a value for the custom field, you have to add the field name to the
switch statement.
case "TOTALQTY": return theTransaction.SaleItems.Sum(s =>
s.Quantity).ToString();
The header example used a simple calculated field to print a value. However, you
want to extend the RetailTransaction object to store extended values that can
then be printed on the receipt. You can do this with the PartnerData object that
is introduced in Microsoft Dynamics AX for Retail 2012 Feature Pack.
The PartnerData object is a dynamic collection that can be defined at run time
instead of compile time. Fields can be stored at the transaction level, the sales line
level, or the payment line level. These fields are then stored in transaction object
and can be used in triggers or services. In the example, you will create a field that
is named “TimeAdded” on the sales line and then use it when you print the
receipt.
1. Open the Triggers solution in Visual Studio and browse to the ItemTriggers
project. Now you have to add several things to the project before you add
the code.
o The PartnerData object relies on a feature that is introduced in
C# 4.0. To use PartnerData in any of the POS code, the project
must add a reference to Microsoft.Csharp
o The example uses the SaleLineItem POS object. This object is in
the Transaction class. The project also requires a reference to
the Transaction.DLL file from the POS installation folder. Make
sure that you set the Copy Local property to False when you add
this reference.
o Finally, a using LSRetailPosis.Transaction.Line.SaleItem; line
must be added to the top of the ItemTriggers.cs file.
2. After this is set up, you must add the following lines to the PreSale() method:
using LSRetailPosis.Transaction.Line.SaleItem;
[...]
public void PreSale(IPreTriggerResult preTriggerResult, ISaleLineItem
saleLineItem, IPosTransaction posTransaction)
{
SaleLineItem s = (SaleLineItem)saleLineItem;
s.PartnerData.TimeAdded = System.DateTime.Now.ToString("HH:mm:ss");
03 - 29
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
3. Now you must read the TimeAdded value when you print sales lines on the
receipt. This is performed in the FormModulation.cs again, this time in the
GetInfoFromSaleLineItem() method.
switch (itemInfo.Variable.ToUpperInvariant().Replace(" ", string.Empty))
{
case "TIMESCANNED": returnValue = saleLine.PartnerData.TimeAdded;
break;
case "TAXID":
returnValue = saleLine.TaxGroupId;
break;
4. Compile the ItemTriggers.dll and Printing.dll and then copy them to the
POS\Services\Extension subfolder in the POS installation. This path applies
only to Microsoft Dynamics AX 2012 R2. For later versions, use
POS\Extensions.
5. Start POS and print a receipt by doing a sale transaction so that you will able
to view the modification in POS.
Similar to this, you can also add custom fields on the following:
Payment Grid
Product Receipt Grid
Totals Area
03 - 30
Module 3: Development and Customization of Retail POS
You can extend Commerce Data Exchange: Real-time Service by adding extension
methods to the RetailTransactionServiceEx class. [For more details see
http://technet.microsoft.com/EN-US/library/retailtransactionserviceex.aspx )
Lesson Objectives
Explain how to extend Commerce Data Exchange - Real time service for POS.
03 - 31
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
RetailTransactionServiceEx Class
To extend the Real-time service, the methods must meet the following criteria:
Example:
The following example shows a method that takes a customer account number
and returns a greeting message that uses the customer’s name. For example, if
customer account number 1001 is associated with a customer named Sandy, the
method would return “Hello Sandy!”
03 - 32
Module 3: Development and Customization of Retail POS
if (accountNumber)
{
select firstOnly Name from dirPartyTable
exists join custTable
where custTable.accountNum == accountNumber
&& dirPartyTable.RecId == CustTable.Party;
if (dirPartyTable)
{
result = [true, 'Success!', strFmt("Hello %1 !",
dirPartyTable.Name)];
}
else
{
result = [false, 'Customer not found'];
}
}
else
{
result = [false, 'accountNumber is null.'];
}
return result;
}
Here, you are calling the new method by using the POS BlankOperation.
LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSStatusPanelText(response
[0] as string);
}
}
catch (CommunicationException ex)
{
LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSStatusPanelText("Request
failed: {0}", ex.Message);
}
operationInfo.OperationHandled = true;
break;
}
}
03 - 33
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
After you do this, compile the BlankOperations project and copy the new
assembly to the POS\Services\Extension folder and then start Retail POS. This path
applies only to Microsoft Dynamics AX 2012 R2. For later versions, use
POS\Extensions.
3. Click the Cashier Tasks button, and then click the MyTask button.
(Add the MyTask blank operation button if it is not yet added). For
more information, refer to the blank operation extension document
for how to add a custom blank operation button and how to
customize this button). If the account number exists it displays the
customer name on the status panel.
4. To modify the existing methods in transaction service class
(RetailTransactionService), add a new pre-event handler or a post
event handler for that method and write the new method logic in the
RetailTransactionServiceEx.
Example:
If a gift card is issued and you want to update a web service, create a new Post
handler and set the class as RetailTransactionServiceEx and the method as
UpdateGiftCardService. UpdateGiftCardService is the new method that is
implemented in the RetailTransactionServiceEx class to update the gift card web
service.
By doing it in this manner, both the existing code and the custom code are
managed separately.
03 - 34
Module 3: Development and Customization of Retail POS
Lesson Objectives
Explain how to extend the Retail Store Database utility to execute custom SQL
scripts.
03 - 35
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
CreateDatabase Service
The CreateDatabase services project is part of the Retail Software Development Kit
(SDK). The SDK can be used to create and extend the retail database. This lesson
explains how to extend the CreateDatabase project to execute custom SQL scripts.
You will create a custom SQL script and try to execute the script by using the retail
store database utility. After the tool successfully runs, you can verify that the
commands in the custom script are executed and that the commands updated the
POSISINFO table with a current version.
1. Before the modification, make a backup of the existing assembly so that the
original assemblies will remain available if you must revert to them.
2. Browse to the folder where you installed the Retail POS SDK. By default, it will
be located in C:\Users\...\Documents\Retail SDK\POS Plug-ins\. Open the
Services\CreateDatabase folder and double-click the CreateDatabase project file
and then add the following library references from the Retail POS folder:
o DataAccess
o EntityFramework
o POSResources
o SystemSettings
o Transaction
o Microsoft.Dynamcics.Retail.Pos.Contracts
o Microsoft.Dynamcics.Retail.Pos.DataEntity
o Microsoft.Dynamcics.Retail.Pos.DataManager
1. Right-click the upgrade folder in the project and then click Add-
>New Item and in the dialog box. Select Text File and name it
Upgrade6.2.0.1.sql, and then click OK. This creates a blank text
file in the Upgrades folder.
03 - 36
Module 3: Development and Customization of Retail POS
2. Now, copy the following statement into that file and then click
the Save icon.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
GO
<POSISUPGRADES>
<UPGRADEVERSION>6.2.0.1</UPGRADEVERSION>
<UPGRADESCRIPT>Upgrade6.2.0.1.sql</UPGRADESCRIPT>
</POSISUPGRADES>
03 - 37
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Example: If the earlier upgrade script version is 6.2.0.0, then the next version will
be 6.2.0.1 and so on. The script file name can be any name in the XML file.
03 - 38
Module 3: Development and Customization of Retail POS
Lesson Objectives
Disclaimer
You can copy, alter, adapt, modify or create derivative works of the Microsoft
Dynamics AX Payment Software Development Kit (SDK) and this
TemplateConnector for payment card processing. Additionally, you must use the
Microsoft Dynamics SDK and the TemplateConnector only with Microsoft
Dynamics AX 2012 R2 /R3 in your internal business operations and with valid
licenses of Microsoft Dynamics AX 2012.
You must not permit or authorize any third-party to distribute any of the
derivative works of the Microsoft Dynamics AX Payment SDK and the
TemplateConnector.
03 - 39
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Payment Connector
You can use the payment connector to connect any Microsoft Dynamics channel
to the payment SDK to process payments. You can also use the payment
connector to connect to different payment devices, such as Hydra.
IPaymentManager
The Microsoft.Dynamics.Retail.PaymentManager.Reference.IPaymentManager is
the interface that is used for all payment devices. This interface exposes the
methods and events for handling devices.
IPaymentProcessor
ISessionOperation
Methods Description
03 - 40
Module 3: Development and Customization of Retail POS
1. Install RetailPOS from the Microsoft Dynamics AX Setup and then unzip the
TemplateConnector.zip file. For the TemplateConnector source code,
download location and license information, refer to the Microsoft Software
License Terms agreement and the developer and demonstration license
agreement.
2. Open TemplateConnector.csproj by using Visual Studio. For
Visual Studio requirements, refer the “Development Environment
Requirements” document.
3. Right-click the TemplateConnector project, and then click properties.
Rename the assembly name to the name that you want the assembly to be
called.
4. On the Signing tab, sign your assembly with a strong name key file. This is
required if you want to deploy your payment connector to the GAC for the
online store.
03 - 41
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
6. Click View > Task List to display the task list. The task list shows all the
elements that you should customize for payment.
03 - 42
Module 3: Development and Customization of Retail POS
You can use the template as a basis for the payment connector. However, you
must add custom business logic to make it function. The areas in the template
that require your attention are marked as TODOs in the task list.
For operations, such as authorize, capture, linked refund, and void, you must
create logic to call out to your payment provider. The logic can use information
from two places—merchant properties as they are entered in Microsoft Dynamics
AX (IP address, username, password, and so on) and the payment request for this
transaction (card number, transaction amount, payment amount, and so on) that
is provided by the application. The results of the call to the payment provider are
then sent back to the application as a response object.
Each of these is a key and, or value data structure. Map the payment request
properties and the merchant properties to the data that is required by the
provider. When the payment provider returns a response, the data should be
extracted and entered in the variables as noted in the example. If you must store a
stable state that is returned by the payment provider, you can create new
properties in the response property bag. Then you can use these properties in
future calls to the payment provider.
03 - 43
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Any error codes that are returned from the payment provider must be mapped to
the enumerated error codes in the Microsoft.Dynamics.Retail.Payment SDK. The
message that is contained in the error code can be customized if the error code is
mapped correctly.
How to use the connector in the channels is described in the following section.
Microsoft Dynamics AX
Copy the connector assembly to the Microsoft Dynamics AX client and the
following server Connectors directories:
03 - 44
Module 3: Development and Customization of Retail POS
AX\60\Server\MicrosoftDynamicsAX\bin\Connectors
Copy the connector assembly to %Pos%\Connectors. (To copy this dll to multiple
installations of POS, you can use System Center.) After the connect assembly is
installed, start POS.
Merchant properties for the payment connector must be entered in each location
that you plan to process card payments. When the assembly is deployed to
Microsoft Dynamics AX, it is automatically included in the payment connector
options and the custom merchant properties are available in the three forms.
Retail Stores
In Microsoft Dynamics AX, browse to Retail > Setup > POS > Profiles >
Hardware profiles. Select an existing hardware profile or create a new profile.
In the EFT Service FastTab, select Payment Connector from the first drop-down
menu. The payment connector should then be available to select in the second
drop-down menu. After you select it, your merchant properties should display:
03 - 45
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
03 - 46
Module 3: Development and Customization of Retail POS
Accounts Receivable
03 - 47
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Objectives
03 - 48
Module 3: Development and Customization of Retail POS
Blank Operations enable you to extend Microsoft Dynamics AX for Retail POS by
adding custom logic to the Retail POS register buttons. In the Retail POS register
design layout you can add any number of blank operation button and specify the
operations information for each button. Later in this guide we will see how to add
blank operation and specify the operation information.
Exercise Scenario
We will add an item to POS transaction and the get the description of the item
and try to search the item description in the Web browser by opening the internet
explorer with the search text (item description)
Detailed Steps
Open the Blank Operation project in Visual studio
a. Open Retail POS Plug-ins from the folder where you installed the
Retail POS SDK. By default it will be C:\Users\...\Documents\Retail
SDK\POS Plug-ins\.For more information about how to install
Retail POS Plug-ins, see Install the Retail SDK.
b. Open the Services folder and double-click the Services Visual
Studio solution file.
c. Go to the Blank Operations project and expand it.
d. Right click the reference node and click Add reference and
browse for the assemblies POSProcessess in Retail POS folder and
select it and click ok.
e. Right-click the BlankOperation project and select properties. In
the properties windows click Build and set the Configuration to
Release and also change the build mode to Release from the drop
down menu in the visual studio menu bar.
f. Open the BlankOperation.cs file and add the below line in the
namespace section
using System;
03 - 49
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
LSRetailPosis.Transaction.RetailTransaction retailTransaction =
posTransaction as LSRetailPosis.Transaction.RetailTransaction;
if (retailTransaction == null ||
retailTransaction.SaleItems.Count == 0)
{
LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSStatusPanelText("Please
add item to transaction");
operationInfo.OperationHandled = true;
return;
}
string description =
retailTransaction.GetItem(operationInfo.ItemLineId).Description;
System.Diagnostics.Process.Start("IExplore.exe",
"www.bing.com/search?q=" + description);
operationInfo.OperationHandled = true;
break; }
}
Catch(Exception ex)
{
LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSStatusPanelText(ex.Messa
ge);
}
}
03 - 50
Module 3: Development and Customization of Retail POS
b. If it is first time log on to POS, then POS will display the Shift
form, in that please click "Add a new Shift".
c. After logging in right-click on the POS button grid area and
select Add row. After that a new row will be created with empty
buttons. Then right-click any empty button and select Button
Properties a new form will popup.
d. In the Action drop-down list box, select Blank Operation. The
Operation number field is a string value that Retail POS uses to
identify your Blank Operation. Because you can send multiple
blank operations to Retail POS simultaneously, you must give
each one a unique identity for Retail POS to distinguish which
ones to execute.
e. The Blank Operation param field enables you to send an optional
string parameter. The Operation number and Blank Operation
param values combine to form the method signature of your
Blank Operation. In this scenario, set the Operation number to
BingSearch and leave the Blank Operation param value.
03 - 51
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Results
Bing search result will be displayed in the internet explore with search text as item
description.
Triggers are used to capture events that fire before and after Microsoft Dynamics
AX for Retail POS operations. You can insert custom logic before the operation
runs or after it has completed.
Exercise Scenario
We want to prompt the cashier for loyalty card request from the customer after
the first item added to transaction
Detailed Steps
Perform loyalty prompt request.
a. Open Retail POS Plug-ins from the folder where you installed the
Retail POS SDK. By default it will be C:\Users\...\Documents\Retail
SDK\POS Plug-ins\.For more information about how to install
Retail POS Plug-ins, see Install the Retail SDK.
b. Open the Triggers folder and double-click the Triggers Visual
Studio solution file.
c. Open the ItemTriggers project because all the item related
triggers operations are done in this project
d. Please add reference to the following assemblies located in the
Retail POS runtime folder by right-clicking the itemtriggers
project and select Add Reference:
i. DevExpress.Utils.v11.2.dll (Needed only if POS was not
installed to the default location on the local machine.)
ii. POSProcesses.dll (Needed only if POS was not installed to the
default location on the local machine.)
iii. System.Windows.Forms.dll
iv. Microsoft.Dynamics.Retail.Pos.SystemCore.dll
v. Transaction.dll (Needed only if POS was not installed to the
default location on the local machine.)
03 - 52
Module 3: Development and Customization of Retail POS
03 - 53
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
PosApplication.Instance.RunOperation(Contracts.PosisOperations.LoyaltyRequ
est, null, posTransaction);
}
}
}
03 - 54
Module 3: Development and Customization of Retail POS
m. If it is first time log on to POS, then POS will display the Shift
form, in that please click "Add a new Shift".
n. Add any item to POS by clicking the product search or Sales or
product sale or by entering/scanning the item barcode. If you
click sales button, categories of item will be displayed, in that
click any category and then click any item from that category.
o. The system will prompt the operator for adding the loyalty card
to transaction.
Results
Popup will be shown to the POS operator for requesting loyalty card request.
Currently the maximum line discount amount doesn’t have manger approval
functionality for giving the discount amount greater than what is defined in the
functionality profile, but in scenarios where the operator want to give more
discount is not possible. To avoid this we can make the POS to prompt for the
manger access to override the discount defined in the functionality profile.
03 - 55
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Detailed Steps
a. Open Retail POS Plug-ins from the folder where you installed the
Retail POS SDK. By default it will be C:\Users\...\Documents\Retail
SDK\POS Plug-ins\.For more information about how to install
Retail POS Plug-ins, see Install the Retail SDK.
b. Open the Services folder and double-click the Services Visual
Studio solution file.
c. Go to the Discount project and expand it.
d. Right-click the Discount project and select properties. In the
properties windows click Build and set the Configuration to
Release and also change the build mode to Release from the drop
down menu in the visual studio menu bar.
e. Please add reference to the following assemblies located in the
Retail POS runtime folder by right-clicking the Discount project
and select Add Reference from Retail POS folder:
i. Microsoft.Practices.Prism.Interactivity
ii. Microsoft.Dynamics.Retail.Notification.Contracts
f. Open the Discount.cs file and add the below lines in the
namespace section as shown below:
namespace Microsoft.Dynamics.Retail.Pos.DiscountService
{
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
using Microsoft.Dynamics.Retail.Notification.Contracts;
03 - 56
Module 3: Development and Customization of Retail POS
if
(FiscalPrinter.FiscalPrinter.Instance.FiscalPrinterEnabled()
&&
!FiscalPrinter.FiscalPrinter.Instance.AuthorizeLineDiscountAmount(saleLine
Item, lineDiscountItem, maximumDiscountAmt))
{
returnValue = false;
}
else if (lineDiscountItem.Amount > itemPriceWithoutDiscount)
{
returnValue = false;
string message =
ApplicationLocalizer.Language.Translate(3177); //The discount amount is
too high. The discount amount cannot exceed the item price.
using (frmMessage dialog = new frmMessage(message,
MessageBoxButtons.OK, MessageBoxIcon.Information))
{
POSFormsManager.ShowPOSForm(dialog);
}
}
else if (lineDiscountItem.Amount > maximumDiscountAmt /
saleLineItem.Quantity)
{
returnValue = false;
string maximumAmountRounded =
this.Application.Services.Rounding.Round(maximumDiscountAmt, true);
decimal maximumDiscountPct = (itemPriceWithoutDiscount ==
decimal.Zero) ? decimal.Zero : (100m * maximumDiscountAmt /
itemPriceWithoutDiscount);
Application.Services.Interaction.InteractionRequest(request);
if
(managerAccessInteraction.Confirmed)
{
// Manager auth was successful
returnValue = true;
} else
{
string message =
03 - 57
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
ApplicationLocalizer.Language.Translate(3173, maximumAmountRounded,
maximumDiscountPct.ToString("n2")); //The discount amount is too high. The
discount percentage limit is set to xxxx %.
return returnValue;
If the discount amount is greater than maximum value we are asking for the
manager confirmation. If the confirmation is true then we are allowing for the
discount by passing the standard functionality.
n. If it is first time log on to POS, then POS will display the Shift
form, in that please click "Add a new Shift".
o. Add any item to POS by clicking the product search or Sales or
product sale or by entering/scanning the item barcode. If you
click sales button, categories of item will be displayed, in that
click any category and then click any item from that category.
p. Next increase the item quantity such that the final price of the item is
greater than 9001. We can increase the quantity by clicking the
following buttons in the POS layout(Sales->Tasks->Edit line->Set
quantity)
03 - 58
Module 3: Development and Customization of Retail POS
q. After that click the Discounts button and select the Line discount
amount and try to give discount amount of 9001 and click OK, next
system will ask for the manager log on information to authorize the
discount.
Use the below operator id and password:
i. Operator Id: 000100
ii. Password: 123
r. Next system will pop up a reason code selection form, in that select
any reason code (The Reason code form will pop up only if it is
configured in HQ).
s. If it is success then the system will give the discount else it will
through the error message.
Results
Exercise Scenario
The existing inventory status functionality will allow us to view the item status of
the stores which belong to the same legal entity. We will modify the query in retail
transaction service class to fetch the inventory status of items across all the legal
entities.
03 - 59
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Detailed Steps
try
{
//New line added for Extending
03 - 60
Module 3: Development and Customization of Retail POS
inventDim.InventLocationId = inventLocation.InventLocationId;
//New line added for Extending changeCompany(inventLocation.dataAreaId)
{
inventDim = InventDim::findDim(inventDim);
if (inventDim.RecId)
{
inventDimParm.initFromInventDim(inventDim);
inventOnhand =
InventOnhand::newItemDim(_itemId,inventDim,inventDimParm);
availPhysical = inventOnhand.availPhysical();
return output;
i. If it is first time log on to POS, then POS will display the Shift
form, in that please click "Add a new Shift".
j. After logging in right-click on the POS button grid area and
select Add row. After that a new row will be created with empty
buttons. Then right-click any empty button and select Button
Properties a new form will popup.
k. In the Action drop-down list box, select Inventory lookup and
click OK.
l. After that click the newly added inventory lookup button.
m. The system will display the inventory status across all legal
entities.
Results
03 - 61
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
1. How can you update the new skin that is created by using the tool in Retail POS?
6. What are the Supported Data Types for Real Time Service calls?
03 - 62
Module 3: Development and Customization of Retail POS
2. You can use the payment connector to connect any Microsoft Dynamics AX
channel to the payment SDK for payment processing.
3. Copy the connector assembly to the Microsoft Dynamics AX client and the
server Connectors directories:
o %Program Files (x86)%\Microsoft Dynamics
AX\60\Client\Bin\Connectors
o %Program Files%\Microsoft Dynamics
AX\60\Server\MicrosoftDynamicsAX\bin\Connectors
4. Triggers are used to capture events that start before and after Microsoft
Dynamics AX for Retail POS operations
03 - 63
MODULE 4: EXTENDING RETAIL MODERN POS
Module Overview
Microsoft Dynamics AX 2012 R3 includes Modern POS, a point-of-sale app for
PCs, tablets, and phones. Sales staff can process sales transactions, customer
orders, and perform daily operations and inventory management with mobile
devices anywhere in the store, as well as at PC-based registers.
The Modern POS app running on a device is a thin client. It must connect to
Microsoft Dynamics AX Retail Server. Retail Server performs the business logic and
processing for Modern POS
The Modern POS system behavior can be customized in several ways. For
example, modifying the information that is made available to modern POS by
extending a commerce entity to include a new column from the Microsoft
Dynamics AX database. The new column in commerce runtime can then be used
in a service and workflow, and exposed in the commerce runtime API. If the
commerce entity is modified, the corresponding controller and metadata in Retail
Server have to be customized.
In other extensibility scenarios, every layer of the stack need not be modified. For
example, simply modify the way a workflow behaves without modifying the
database schema.
The Retail SDK includes apps for various clients. You can customize those apps to
match the branding of your organization or to extend their functionality.
Objectives
Lesson Objectives
Modern POS clients can communicate with Retail Servers that are deployed in
your store or in a data center. Modern POS clients can also communicate with
peripheral devices such as cash drawers, credit card readers, and printers by using
Microsoft Dynamics AX Hardware Station. Hardware Station must be deployed in
your store and all Modern POS clients can connect to the same Hardware Station.
On supported laptops, tablets, and phones, Modern POS users can perform a
variety of retail tasks. These include processing sales transactions, viewing
customer orders, managing daily operations and inventory, or viewing role-based
reports. The Microsoft Dynamics AX Modern POS device is a client. It does not
perform business functions or data processing. All business functions are provided
by Microsoft Dynamics AX Retail Server.
04 - 2
Module 4: Extending Retail Modern POS
The Modern POS app running on a device is a thin client. It must connect to
Microsoft Dynamics AX Retail Server. Retail Server performs the business logic and
processing for Modern POS.
The view, view-controller, and devices layers depend on the operating system (for
example, Windows Surface) on which you plan to deploy Modern POS. The other
layers are operating system independent and use Typescript classes and modules
to perform Modern POS functionality such as workflows and entities.
Cascading style sheets is a style sheet language that is used to describe the look
and format of a document that is written in a markup language. Although
04 - 3
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
frequently used to style web pages and interfaces that are written in HTML and
XHTML, the language can be applied to any kind of XML document. This includes
plain XML, SVG and XUL. Cascading style sheets is a cornerstone specification of
the web and most webpages use Cascading style sheets to describe their
presentation.
Information on the web technologies that can be used to theme HTML5 pages
can be found at http://www.microsoftvirtualacademy.com/training-
courses/html5-css3-fundamentals-development-for-absolute-beginners
This topic describes the architecture of Retail Server. Retail Server provides services
and business logic for Modern Point of Sale (POS) clients.
Concept Description
Entity type An entity type is an entity that has a lifecycle
you want to monitor. Each entity type has a
key. An example of an entity type is Customer.
04 - 4
Module 4: Extending Retail Modern POS
Concept Description
each commerce entity. You can customize
the following controllers:
Carts
Catalogs
Categories
Commerce
Commerce Lists
Composite Key Entity
Controller Assembly Resolver
Customers
Employees
Non-Bind able Action
Org Units
Picking Lists
Products
Purchase Orders
Sales Orders
Shifts
Stock Counts Journals
Transfer Orders
To extend the Retail Server you can create your own entity type or complex type,
extend an existing controller, add a new controller, and customize the metadata. If
the commerce runtime is customized, then the various components in Retail
Server should also be customized to expose those changes to Modern POS clients.
04 - 5
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
In other extensibility scenarios, every layer of the stack need not be modified. For
example, simply modify the way a workflow behaves without modifying the
database schema.
The Retail SDK includes apps for various clients. You can customize those apps to
match the branding of your organization or to extend their functionality.
04 - 6
Module 4: Extending Retail Modern POS
Lesson Objectives
The following are the main tasks to be done on the Microsoft Dynamics AX side
Enable debugging You can use the X++ Debug X++ Code
debugger to debug from for Retail
commerce runtime to Real- http://technet.micros
time Service to Microsoft oft.com/EN-
Dynamics AX, but you must
04 - 7
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
The commerce runtime is a set of assemblies that enables your store to obtain
interactive data based on a shopping cart. The commerce runtime includes several
services that query for real-time data. It also includes workflow business logic that
enforces rules for your store.
04 - 8
Module 4: Extending Retail Modern POS
Use the API You can use the API for things .NET Framework
like getting information about Classes for
items, price calculation, Microsoft
shipping calculation, and Dynamics AX
placing orders. You can extend Commerce
the API to fit your business Runtime
processes. http://technet.micr
osoft.com/EN-
US/library/jj992752
.aspx
04 - 9
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
04 - 10
Module 4: Extending Retail Modern POS
You can customize the look and feel of a Modern POS client to make it an
extension of your brand. We recommend that you use your own file names and
namespaces for any customizations.
04 - 11
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Extend The Retail SDK includes sample code that you Retail SDK
Modern can use to create your own Windows Phone http://technet.
POS for Modern POS app. microsoft.com/
Windows EN-
Phone US/library/dn7
client 20295.aspx
Windows
Phone Dev
Center
http://develope
r.windowsphon
e.com/en-us
Enable The Windows Phone app in the Retail SDK Enable reports
Modern contains code you can use for reports. You must for Microsoft
POS for install Silverlight libraries, uncomment code Dynamics AX
Windows from certain files in the Windows Phone app, Retail
Phone and then add references to the Silverlight Windows
reports toolkit. Phone Point of
Sale
http://technet.
microsoft.com/
EN-
US/library/dn7
41448.aspx
Package After you have customized one of the mobile Create an app
your apps that are available in the Retail SDK, you can package
changes
04 - 12
Module 4: Extending Retail Modern POS
Install a After you extend one of the apps that are Install Modern
customiz available in the Retail SDK, you must use side- POS
ed app loading to install it to devices. http://technet.
microsoft.com/
EN-
US/library/dn7
41434.aspx#Cu
stomized
04 - 13
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
This exercise illustrates adding a field to a retail channel that enables customers to
opt in to receive special offers by email. In this scenario, the retailer wants to
indicate whether customers wish to receive email about special offers in a modern
POS client.
Detailed Steps
04 - 14
Module 4: Extending Retail Modern POS
04 - 15
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
04 - 16
Module 4: Extending Retail Modern POS
5. Add a Primary Key based foreign key to the CustTable relation, and
set the SourceEDT as CustAccount, rename the newly created field
CustTable to AccountNum
04 - 17
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
04 - 18
Module 4: Extending Retail Modern POS
8. Generate the CIL code for the new table by clicking Compile
04 - 19
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
04 - 20
Module 4: Extending Retail Modern POS
04 - 21
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
In the CRT, each entity is represented by a key-value pair. The key has the name of
the column name in the table or view. The value is the value of the field for that
column in the view. When you create the new fields in the CustomersView, the
new key-value pair is included in the property bag. For more information see
Customize the Data in a Commerce Entity- http://technet.microsoft.com/EN-
US/library/jj916616.aspx
Next, you will modify the stored procedure associated with the CustomersView
view. This enables writing the data back to Microsoft Dynamics AX.
Set up and run a subjob to synchronize values for the new data field to the online
channel database
Detailed Steps
04 - 22
Module 4: Extending Retail Modern POS
In the CRT, each entity is represented by a key-value pair. The key has the name of
the column name in the table or view. The value is the value of the field for that
column in the view. When you create the new fields in the CustomersView, the
new key-value pair is included in the property bag. For more information see
Customize the Data in a Commerce Entity - http://technet.microsoft.com/EN-
US/library/jj916616.aspx.
Next, you will modify the stored procedure associated with the CustomersView
view. This enables writing the data back to Microsoft Dynamics AX.
You must add the EmailOptIn field to the CustomersView view in the channel
database to make the new field available in the Retail online sample store.
04 - 23
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Set up and run a subjob to synchronize values for the new data field to the online
channel database
You run jobs to synchronize data from AX 2012 to the CRT. For more information,
see http://technet.microsoft.com/EN-US/library/jj680084.aspx
In the AX 2012 Distribution schedule form, create a subjob under the Customer
job for RetailCustPreferences. Run the jobs that synchronize initial data in AX 2012
to the distribution location
http://technet.microsoft.com/EN-US/library/dn720790.aspx
There are four places where code has been inserted. Search for
SDKSAMPLE_CUSTOMERPREFERENCES to find them.
Add the RetailCustPreferences table in the data distribution to the CRT for the
Retail channel
Detailed Steps
Add the RetailCustPreferences table in the data distribution to the CRT for the
Retail channel
The channel schema is the XML description of the data sent from AX 2012 to the
04 - 24
Module 4: Extending Retail Modern POS
channel database.
04 - 25
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
RECID None 0
Next create a Subjob of the CustTable job to move data in the new table to the
channel database.
04 - 26
Module 4: Extending Retail Modern POS
7. On the Field list form, click Functions and then click Match fields to
generate all matching fields. The From Field and To Field columns
are filled in.
04 - 27
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
04 - 28
Module 4: Extending Retail Modern POS
Notepad++. [To copy all the XML position your cursor and click
before the first character (<). Using the scrollbar, scroll to the bottom
of the file. Press Shift and then click after the last character (>). This
ensures that all the XML is selected.]
11. In the XML search for the line <Table name= “RetailCustTable”>.
There are two instances it appears.
12. Add the following highlighted RetailCustPreference definition after
the final line in both of the <Table name= “RetailCustTable”> code
blocks. You add the code after the </Table> statement.
<Table name="RetailCustPreferences">
<LinkGroup>
</LinkGroup>
</Table>
13. Copy the entire new XML file into the Table Distribution window on
the Retail channel schema form.
04 - 29
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
17. On the Retail Channel Schema form, select AX 2012 R3 for the
schema name and then click Generate Classes to generate needed
CDX Async classes
Detailed Steps
04 - 30
Module 4: Extending Retail Modern POS
// HOL
this.emailOptIn = ko.observable(false);
04 - 31
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
this.emailOptIn.subscribe((newEmailOptIn) => {
// this._emailOptInProperty.Value.IntegerValue = (newEmailOptIn ? 1 :
0);
//}
this.addUpdateExtensionProperty(this._emailOptIn_Key, (newEmailOptIn
? 1 : 0));
});
// HOL
// HOL
if (this.CustomerProxy) { if
(!this.CustomerProxy.ExtensionProperties()) {
this.CustomerProxy.ExtensionProperties = ko.observableArray([]);
04 - 32
Module 4: Extending Retail Modern POS
var properties =
this.CustomerProxy.ExtensionProperties().filter((property) => {
});
if (ArrayExtensions.hasElements(properties)) {
emailOptInP = properties[0];
else {
emailOptInP.Key = key;
this.CustomerProxy.ExtensionProperties().push(emailOptInP);
if (!emailOptInP.Value) {
emailOptInP.Value = new
Model.Entities.CommercePropertyValueClass();
emailOptInP.Value.IntegerValue = intValue;
// HOL
04 - 33
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
// HOL
});
if (ArrayExtensions.hasElements(properties)) {
if (emailOptInProperty.Value) {
this.emailOptIn(emailOptInProperty.Value.IntegerValue
=== 1);
04 - 34
Module 4: Extending Retail Modern POS
// HOL
<div>
<br />
data-bind="checked:
customerAddEditViewModel.emailOptIn"/>
</div>
04 - 35
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
select No
6. Follow the steps and enter needed info, click Create to create the
04 - 36
Module 4: Extending Retail Modern POS
package
In this scenario you will walkthrough simple customizations of the Modern POS
which can be done from the Retail HQ
Detailed Steps
04 - 37
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Before you start the task select an image for the Login Page and Welcome Page
of the Modern POS and save the image files in a folder of the computer where
this configuration will be done
Detailed Steps
1. Browse to AX > Retail > Setup > POS > Profiles > Visual profiles, and
then click New.
/
04 - 38
Module 4: Extending Retail Modern POS
Detailed Steps
1. In Microsoft Dynamics AX browse to Retail > Setup > POS > POS
registers, and then click New.
/
Detailed Steps
1. Browse to Retail > Setup > POS> Button grids, click New and
specify the following, and then click Designer.
o Button grid ID: HOL1
o Name: HOL Tasks
2. Expand the form so that all the options are visible, and then select
“New design.”
/
3. Specify 6 rows and 4 columns, and then click OK.
/
04 - 39
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Create a button grid with the following layout by deleting buttons and setting the
row and column span for the remaining buttons.
Specify the button grid operations, colors, fonts, and images for each button.
Detailed Steps
1. In Microsoft Dynamics AX, browse to Retail > Setup > POS > Screen
layouts, click New and then specify the following:
Screen layout ID: HOL1
Name: HOL1
Device application: Windows 8
Height: 768
Width: 1366
2. In the Button grids section click Add and then select the following:
o Welcome screen 1 = 850 “Get Started”
o Transation screen 1 = HOL1 “HOL Tasks”
o Transaction screen 2 = FAB802 “Payment methods”
3. In the Images section, click Add and specify the following, and then
click Designer.Add Welcome screen 1 = 9001
1. Use the drag-and-drop designer to add the following components to
the layout:
04 - 40
Module 4: Extending Retail Modern POS
04 - 41
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Detailed Steps
/
3. Select job “1060 – Staff” and then click “Run now.”
4. Give the jobs some time to finish and then return to Modern POS.
Results
Add an Image
04 - 42
MODULE 5: EXTENSIBILITY TESTING
CONSIDERATIONS
Module Overview
This module explains the different ways to test Point of Sale (POS) and the
information that you must consider before testing begins.
Objectives
Explain the testing considerations for several testing types for the POS
customization.
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Testing
Types of Testing
Unit Testing
Unit tests are written by developers and run under a unit testing framework, such
as Microsoft Visual Studio Team System or NUnit. Unit tests isolate and verify
discrete units of program logic. Unit tests isolate the logic by replacing
dependencies on the run-time environment, such as SharePoint, with test-
provided substitutes. Isolation lets unit tests run quickly, and developers can run
unit tests frequently.
Acceptance Testing
Acceptance tests consist of multiple steps that represent realistic usage scenarios
for the whole application. These tests verify that an application meets the
requirements of the intended users. Their scope includes usability, functional
correctness, and performance. Generally, test engineers create these tests.
Configuration Testing
Functional Testing
Integration Testing
Performance Testing
05 - 2
Module 5: Extensibility Testing Considerations
testing involves Functional testing that is performed to evaluate the compliance of
a system or component that has specified performance requirements.
User Testing is performed by functional and, or testing teams to check how user-
friendly the application is.
Some standard POS operations testing can be automated by using the standard
POS test Automation functionality. If you modify the POS shortcut and append a
‘-te’ as a command-line argument, POS will run in a special test mode where POS
runs the tests that are set up in the Retail POS database.
For example: To automate the POS operation, insert records in the POSISTESTs
table and the POSISTESTPROCESS table by using the following scripts:
Hardware Testing
Hardware testing tests the hardware devices that are connected to a POS
application that has different configurations. Before the device is tested with POS,
you must test all the hardware devices that have the test utility that is provided by
the device manufacturer. This helps make sure that the devices are working
correctly.
05 - 3
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Bar code scanner testing checks whether the scanner reads the code of an item
correctly and displays the price that corresponds to that item.
Printers
Printer testing verifies whether the correct information that is related to an item is
printed on different receipts that are generated at the printer. The correct
information that is related to the customer, such as the items ordered and the
total should be printed on the receipts.
Weighing Scale
Weight scale testing is used to weigh items sold by weight. The scale should
display the exact quantity of an item that is put on the scale and the price should
be displayed according to the weight of the item.
Cash Drawer
Cash draw testing checks whether the cash drawer opens when an order is
submitted or when a check is settled.
Line Display
The testing of the tower displays the item that is ordered and the price. This helps
the customer view the item he or she ordered. Line display testing also displays
the amount due, the amount tendered and the change that is given to the
customer. A tower is tested against this information to check whether correct
information is displayed on the tower.
Keyboard
Keyboard testing checks whether the correct keyed data is displayed and
processed.
EFT Testing
If there is integration to any Independent Software Vendor (ISV), test all the POS
05 - 4
Module 5: Extensibility Testing Considerations
standard operations.
05 - 5
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Challenges
Multiple Configurations
Peripheral Issues
The peripheral issues can be related to devices that are connected to a POS, such
as bar code scanners, scales, printers, towers and cash drawers.
Complex Interfaces
Integration of the POS system involves several interconnected systems and third-
party elements. Systematic test design techniques are followed to reduce the
complexity of interfaces.
Upgrades
PCI Compliance
05 - 6
Module 5: Extensibility Testing Considerations
Testing Considerations
Testing considerations include the following:
05 - 7
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
UI Testing Considerations
Ease of usage
Screen resolution of the target systems
05 - 8
Module 5: Extensibility Testing Considerations
Module Review
Module Review and Takeaways
This module explained the different kinds of testing that is involved in the POS
deployment. Additionally, the module explained the testing challenges that are
involved and the elements that you must consider before testing begins.
05 - 9
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
1. -te
2. POSISTESTs and POSISTESTPROCESS
05 - 10
MODULE 6: EXTENSIBILITY DEPLOYMENT AND
HOTFIX UPDATE CONSIDERATIONS
Module Overview
This module provides information and resources to help you successfully deploy
the Microsoft Dynamics AX 2012 R3 Point of Sale (POS) customization and
hotfixes. The module describes the steps that are involved in the planning of and
the considerations for the Retail POS customization and hotfix deployment.
Objectives
If you are running a retail environment, there are additional steps that you must
perform to deploy updates and hotfixes to computers running Retail POS,
Commerce Data Exchange components, or a store database. Retail software at the
store can be updated in any order or simultaneously.
We recommend that you perform these steps initially in a test environment local to
your headquarters, validate that all fixes perform as anticipated and then roll them
out to your stores.
Updates included in a hotfix should be applied to all computers that host the
updated components. For example, you should run the same version of
Commerce Data Exchange: Synch Service at all stores and at headquarters.
Environments that run different versions of the same Retail component are not
supported. In some cases, deployed fixes will not be fully available until all
components included in the hotfix have been updated. For example, a Commerce
Data Exchange: Real-time Service update might also require a code change at
headquarters.
06 - 2
Module 6: Extensibility Deployment and Hotfix Update Considerations
Deployment Components
The types of computers that are used in a typical Microsoft Dynamics AX 2012 R3
Retail deployment are shown in the following table:
Brick-and- Computer that hosts the channel database and Async Client
mortar Point of sale (POS) devices
stores
Correct planning before a system is deployed can minimize the downtime of the
system. The deployment should be conducted in the following environments
before the system is deployed in the production environment.
06 - 3
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
1. At the store, bring offline registers online and make sure that offline
transactions have been synchronized with the store database. [Note :
If you skip this step, severe data damage and possible financial losses
can occur. After you upgrade the store database, you can no longer
synchronize transactions from existing offline databases]
2. Run P jobs to synchronize local transactions with headquarters. For
more information, refer to “Schedule and run jobs in Retail
Scheduler.”
3. Back up the store database by using Microsoft SQL Server
Management Studio.
All instances of these applications must be updated to the same version. Partly
updated environments are not supported. It is likely that deployed fixes will not
be fully available until all components in an environment are running the same
versions.
Only binary updates require additional actions. You must synchronize your
databases with headquarters, back up the database, and install binary updates to
non-database and database components. Then, if you have customized Retail
POS, you must re-merge your code changes to services and triggers, compile, and
re-deploy.
Before you deploy the POS customized libraries, make a backup of the existing
Retail POS folder and then copy the custom libraries. Copy the customized
services or triggers library to POS\Extension.
For more information about the retail general deployment, refer to topic “Deploy
Updates in a Retail Environment”- http://technet.microsoft.com/en-
us/library/dn305851.aspx
06 - 4
Module 6: Extensibility Deployment and Hotfix Update Considerations
If you have customized Retail POS, you must re-merge your code changes to
services and triggers, compile, and then re-deploy the customized assemblies.
For more information about how to handle customizations in an update, see the
blog post AX for Retail: Managing and Maintaining POS Customizations
http://blogs.msdn.com/b/axsupport/archive/2013/07/08/ax-for-retail-managing-
and-maintaining-pos-customizations.aspx from the Microsoft Dynamics AX
Support team.
If you have an Independent Software Vendor (ISV) code in your POS, then the ISV
code should also be merged with the code changes from the hotfix. Then you can
compile and re-deploy the code changes in in POS\Extension folder.
If there are multiple developers working on the POS customization then the hotfix
code changes should be merged in the code branch. By doing this, all developers
will have the latest code.
06 - 5
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Note: In AX 2012 R2 and AX 2012 Feature Pack, the Retail Channel Configuration
Utility is called the Retail Store Database Utility.
At the store, start by updating the Retail Channel Configuration Utility on one
computer. If other Retail software is installed on this computer, you can also
update that software.
o Browse to the location where you extracted the files for the update, and then
double-click AxUpdate.exe.
o Install updates.
You do not have to restart the Application Object Server (AOS) after you install
the binary retail components.
To upgrade retail databases, you must run an updated version of the Retail
Channel Configuration Utility. Upgrade the store database before you upgrade
offline databases on POS registers.
2. Enter the information for the store database and then click Apply or Continue.
06 - 6
Module 6: Extensibility Deployment and Hotfix Update Considerations
Caution: It can take several hours to upgrade offline databases. Offline mode is
not available until the store database has been provisioned and an offline
database has been created on at least one register. If your environment relies
heavily on offline mode, consider these factors when you plan the update.
2. On each computer where offline mode will be available, run the Retail Channel
Configuration Utility to upgrade offline databases
For more information about Microsoft Dynamics AX hotfixes and how to update a
deployment, refer to “Apply Hotfix and Update AX 2012.”
[http://technet.microsoft.com/en-us/library/hh335183.aspx ]
06 - 7
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Module Review
06 - 8
Module 6: Extensibility Deployment and Hotfix Update Considerations
06 - 9
Module 7: LAB – MPOS - Extensibility
Allow call center users using Dynamics AX 2012 R3 to collect/modify customer’s email
preference
Detailed Steps
Create a new Dynamics AX 2012 R3 table
1. Launch to Dynamics AX 2012 R3 , go to (press Ctrl+Shift+W) AOT > Data Dictionary
> Tables
2. Create a new table RetailCustPreference
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
5. Add a PrimaryKey based foreign key to the CustTable relation, and set the
SourceEDT as CustAccount, rename the newly created field CustTable to
AccountNum
8. Generate the CIL code for the new table by clicking Compile
9.
13. Add a new field EmailOptIn from table RetailCustPreference within the
CustomerPreference group
14. Update method CustTable: write to set retailCustPreference.AccountNum =
custTable.AccountNum;
17. Go to Accounts receivable > Common > Customers > All customers, edit a
customer record, go to Retail fasttab, check Email Opt In checkbox, and save.
18. Launch to Dynamics AX 2012 R3 , go to Retail > Setup > Retail scheduler, open Retail
channel schema, and select AX 2012 R3
1. Create a new subjob RetailCustPreference with the following highlighted data by going to Retail
> Setup > Retail scheduler > Scheduler subjobs form
2. On Schedular subjob form, click Transfer field list to open the Field list form
3. On the Field list form, click Functions > Match fields to generate all matching fields.
4. Go to Retail > Setup > Retail scheduler, open Retail channel schema, and select AX 2012 R3,
in the Retail data distribution fasttab, add the following highlighted RetailCustPreference
definition to the Table distribution
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
<Table name="CustTable">
<LinkGroup>
<Link type="FieldMatch" fieldName="Party" parentFieldName="RecId" />
</LinkGroup>
<Table name="RetailCustPreference">
<LinkGroup>
<Link type="FieldMatch" fieldName="AccountNum" parentFieldName="AccountNum"
/>
</LinkGroup>
</Table>
<Table name="RetailCustTable">
<LinkGroup>
<Link type="FieldMatch" fieldName="accountNum" parentFieldName="AccountNum"
/>
</LinkGroup>
</Table>
</Table>
5. Add subjob RetailCustPreference to job 1010 by going to Retail > Setup > Retail scheduler >
Scheduler jobs form
6. Click Generate classes to generate needed CDX Async classes
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Task Overview
1. Extend channel database to store email preference
2. Configure CDX Async services to send email preference to channels
3. Extend Commerce Runtime and Retail Server to read/save email preference
4. Extend CDX real-time service to save email preference to central DYNAMICSAX 2012 R3
5. Extend mobile POS user interface to collect email preference
Detailed Steps
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
[RECID] ASC
) ON [PRIMARY]
GO
GO
GO
GO
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
SELECT
ct.ACCOUNTNUM AS ACCOUNTNUMBER,
ct.RECID,
ct.CREATEDDATETIME,
dpt.RECID AS PARTY,
dpt.NAME,
dpn.RECID AS PERSONNAMEID,
dpn.FIRSTNAME,
dpn.MIDDLENAME,
dpn.LASTNAME,
dpt.PARTYNUMBER,
dpt.INSTANCERELATIONTYPE,
ceap.LOCATOR PHONE,
ceap.LOCATOREXTENSION PHONEEXT,
ceap.RECORDID PHONERECORDID,
ceae.LOCATOR EMAIL,
ceae.RECORDID EMAILRECORDID,
ceau.LOCATOR URL,
ceau.RECORDID URLRECORDID,
ceacp.LOCATOR CELLPHONE,
ceacp.RECORDID CELLPHONERECORDID,
rct.RECEIPTEMAIL RECEIPTEMAIL,
dpt.LANGUAGEID AS LANGUAGE,
ct.DATAAREAID,
rct.RECID RETAILCUSTOMERRECID,
ct.CURRENCY,
ct.INVOICEACCOUNT,
ct.CREDITMAX,
ct.ONETIMECUSTOMER,
ct.MARKUPGROUP,
ct.PRICEGROUP,
ct.CUSTGROUP,
ct.BLOCKED,
ct.ORGID,
ct.MULTILINEDISC,
ct.USEPURCHREQUEST,
ct.LINEDISC,
ct.INCLTAX,
ct.ENDDISC,
ct.TAXGROUP,
ct.CREDITRATING,
ct.TAXLICENSENUM,
ct.VATNUM,
ct.IDENTIFICATIONNUMBER
, isnull(rcp.EMAILOPTIN, 0) as EMAILOPTIN
FROM [ax].CUSTTABLE ct
-- phone
-- url
-- cellphone
AND ceacp.METHODYTPE = 1
AND ceacp.ISPRIMARY = 0
AND ceacp.ISMOBILEPHONE = 1
-- email preference
)
GO
-- HOL
-- HOL
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
1. Launch to Dynamics AX 2012 R3 , go to Retail > Periodic > Data distribution > Distribution
schedule, run job 1010 Customers to send data to channels
Extend mobile POS to add email preference on the customer edit page
// HOL
this.emailOptIn = ko.observable(false);
this.emailOptIn.subscribe((newEmailOptIn) => {
//if (this._emailOptInProperty && this._emailOptInProperty.Value) {
// this._emailOptInProperty.Value.IntegerValue = (newEmailOptIn ? 1 : 0);
//}
this.addUpdateExtensionProperty(this._emailOptIn_Key, (newEmailOptIn ? 1 :
0));
});
// HOL
b. Add the following method to class CustomerAddEditViewModel
// HOL
private addUpdateExtensionProperty(key: string, intValue: number) {
if (this.CustomerProxy) { if
(!this.CustomerProxy.ExtensionProperties()) {
this.CustomerProxy.ExtensionProperties = ko.observableArray([]);
}
if (!emailOptInP.Value) {
emailOptInP.Value = new Model.Entities.CommercePropertyValueClass();
}
emailOptInP.Value.IntegerValue = intValue;
}
}
// HOL
// HOL
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
});
if (ArrayExtensions.hasElements(properties)) {
if (emailOptInProperty.Value) {
// HOL
<div>
<br />
data-bind="checked: customerAddEditViewModel.emailOptIn"/>
</div>
4. Build the project by going to BUILD > Build Solution in Visual Studio 2012
5. Create a package by selecting POS project, then go to menu PROJECT > Store > Create App
Packages…,
select No
Microsoft Dynamics® AX 2012 R3 for Retail in Brick in Brick and Mortar
Stores: Development and Customization
Follow the steps and enter needed info, click Create to create the package
6. Deploy the package location to deploy the package
Go to ..\POS Clients\Windows\C1\AppPackages\RetailModernPOS_x64_Test, right click Add-
AppDevPackage.ps1 and select Run with PowerShell, and follow the steps to complete the
deployment