• No results found

80585 Ax2012 Enus Retail All

N/A
N/A
Protected

Academic year: 2021

Share "80585 Ax2012 Enus Retail All"

Copied!
152
0
0

Loading.... (view fulltext now)

Full text

(1)

Table of Contents

Module 1: MICROSOFT DYNAMICS AX 2012 R2 FOR RETAIL IN

BRICK AND MORTAR STORES- DEVELOPMENT AND

CUSTOMIZATION

Lesson 1: Course Objectives ... 1-1

Module 2: INTRODUCTION TO POINT OF SALE (POS) OVERVIEW

Lesson 1: Introduction to POS ... 2-2

Module 3: POS EXTENSIBILITY TECHNICAL OVERVIEW

Lesson 1: Extend Point of Sale ... 3-2 Lesson 2: Retail POS Plug-ins ... 3-2 Lesson 3: Commerce Data Exchange: Real-time Service Calls ... 3-5

Module 4: POS FRAMEWORK

Lesson 1: POS Architecture Overview ... 4-2

Module 5: DEVELOPMENT ENVIRONMENT REQUIREMENTS

Lesson 1: Development Environment Requirements ... 5-2

Module 6: TECHNICAL BACKGROUND

Lesson 1: Technical knowledge required to customize POS ... 6-2

Module 7: LOCALIZATION INFORMATION

Lesson 1: POS Localization ... 7-2

1

Microsoft Official Training Materials for Microsoft Dynamics ®

(2)

Development and Customization

Module 8: EXTENSIBILITY BEST PRACTICES

Lesson 1: Solution Approach ... 8-2 Lesson 2: Reference ... 8-5

Module 9: LOGON EXTENSIBILITY – SAMPLE AND HOW-TO

Lesson 1: Logon Extensibility ... 9-2

Module 10: POS THEMES

Lesson 1: POS Skins ... 10-2

Module 11: USER-INTERFACE EXTENSIBILITY – SAMPLE AND

HOW-TO

Lesson 1: How to Modify a Form in Microsoft Dynamics AX 2012 R2 POS ... 11-2

Module 12: TRIGGER EXTENSIBILITY – SAMPLE AND HOW-TO

Lesson 1: How to Modify the Trigger Project ... 12-2

Module 13: SERVICES EXTENSIBILITY – SAMPLE AND HOW-TO

Lesson 1: How to Modify the Services Project ... 13-2

Module 14: BLANK OPERATION EXTENSIBILITY

Lesson 1: Blank Operation on the Retail POS Register ... 14-2

Module 15: CUSTOM FIELDS ON POS LAYOUTS

(3)

Table of Contents

Module 16: REAL-TIME SERVICES EXTENSIBILITY – SAMPLE AND

HOW-TO

Lesson 1: Extending the RetailTransactionServiceEx Class ... 16-2

Module 17: POS PAYMENT CONNECTOR

Lesson 1: Payment Connector ... 17-2

Module 18: POS DATABASE TOOL EXTENSIBILITY FOR STORE

AND OFFLINE DATABASE

Lesson 1: CreateDatabase Service ... 18-2

Module 19: EXTENSIBILITY TESTING CONSIDERATIONS

Lesson 1: Testing ... 19-2 Lesson 2: Challenges ... 19-5 Lesson 3: Testing Considerations ... 19-6

Module 20: EXTENSIBILITY DEPLOYMENT AND HOTFIX UPDATE

CONSIDERATIONS

Lesson 1: Deployment Planning ... 20-2 Lesson 2: Deploy POS Customizations ... 20-3 Lesson 3: Merge Any Existing Code Changes with POS and Redeploy ... 20-4 Lesson 4: Install Updates to Non-Database Retail Components ... 20-4 Lesson 5: Install Updates to Store Databases by Using the Retail Database Utility ... 20-5 Lesson 6: Install Update to CDX: Real-Time Service... 20-5

Module 21: EXTENSIBILITY LAB MANUAL

3

Microsoft Official Training Materials for Microsoft Dynamics ®

(4)
(5)

MICROSOFT DYNAMICS AX 2012 R2 FOR RETAIL IN

BRICK AND MORTAR STORES- DEVELOPMENT AND

CUSTOMIZATION

Course Objectives

The main objectives of the Microsoft Dynamics for Retail in Brick and Mortar Stores course is to understand the development and customization that is explained in the following topics:

• Introduction to Point of Sale (POS) – Overview • POS extensibility technical overview

• POS Framework

• Development environment requirements

• Extensibility Interface Definition – Triggers and Services • Technical background

• Localization Information • Extensibility Best practices

• Logon Extensibility – Sample and How-to • POS Themes

• User-interface Extensibility – Sample and How-to • Trigger Extensibility – Sample and How-to • Services Extensibility – Sample and How-to • Blank Operation Extensibility

• Custom Field on POS Layouts

• Real-time services Extensibility – Sample and How-to • Device Integration – (Hydra, EFTPOS)

• POS Database Tool Extensibility For Store and Offline Database • Extensibility testing considerations

• Extensibility deployment considerations

• Deployment of ongoing hotfixes for Customized POS for version(s) and code maintenance

1 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(6)

Development and Customization

Module Review

Student Objectives

1. What do you expect to learn by participating in this course? 2. List three main objectives.

(7)

MODULE 2: INTRODUCTION TO POINT OF SALE

(POS) OVERVIEW

Module Overview

Microsoft Dynamics AX for Retail POS is the point of sale (POS) program for Microsoft Dynamics AX. POS tasks are performed by using a POS register. The graphical user interface (UI) is easy to use and can be set up to meet the

requirements of many industries, such as grocery, fashion and specialty retailers.

Objectives

The main objective of this module is to discuss the Microsoft Dynamics POS Overview.

2- 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(8)

Development and Customization

Introduction to POS

Microsoft Dynamics AX for Retail POS

Microsoft Dynamics AX Retail POS is a solution that brings speed, power, flexibility, dependability, and ease of use to the point-of-sale. 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.

(9)

Module 2: Introduction to Point of Sale (POS) Overview

Microsoft Dynamics Retail Components:

Microsoft Dynamics POS interacts with the following retail components to perform end to end operations:

• Commerce Data Exchange: Synch service • Commerce Data Exchange: Real time service • Store and offline database

Microsoft Dynamics AX for Retail Synch Service:

Synch service is the integrated service that periodically sends data between the head office and store database. Communications that use synch service are managed through distribution locations and Retail Scheduler in Retail Headquarters (HQ).

Microsoft Dynamics AX for Retail Real time Service:

Together with synch service and Retail Scheduler, real-time service completes the communications mechanism of Microsoft Dynamics AX for Retail by providing 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 head office and the stores, and more.

Store Database:

Each store must have its’ own database, and a single database is used for multiple registers. 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.

2 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(10)

Development and Customization

Microsoft Dynamics POS Operations

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.

The following operations cannot be performed when the store database is offline: • Print an X report

• Print a Z report • Close a shift • Blind-close a shift • View blind-closed shifts • Suspend a shift, plus more

(11)

Module 2: Introduction to Point of Sale (POS) Overview

The following operations cannot be performed when the connectivity to HQ is not working (CDX: Real time service connection down):

• Inventory Lookup • Gift Card Operations • Loyalty Operations

• Customer order Operations, plus more

2 - 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(12)

Development and Customization

Module Review

Module Review and Takeaways

• About Microsoft Dynamics AX 2012 POS • Real time service

• Synch service • POS Operations

• Store and Offline database.

Test Your Knowledge

Test your knowledge with the following questions. 1. What is the CDX: Synch service used for? 2. What is the CDX Real-time service used for?

3. What is the difference between the CDX synch service and the CDX Real-time service?

4. Describe any POS Operations.

5. Can an offline database be shared across multiple terminals?

6. Describe any two operations that cannot be performed when the POS store database is offline.

(13)

Module 2: Introduction to Point of Sale (POS) Overview

Test Your Knowledge Solutions

MODEL ANSWER:

1. Synch service is the integrated service that periodically sends data between the head office, stores, and individual Retail POS terminals. 2. Real-time service completes the communications mechanism of

Microsoft Dynamics AX for Retail by providing real-time, synchronous communication.

3. Synch service is used for synching the data between HQ and POS. Real time service is used for providing real-time information form the HQ.

4. Receive payment operation. This operation can be used to receive payment from the customer in POS through different tender types that are configured in HQ.

5. No. Only the store database can be shared across multiple terminals. 6. Close shift and print Z-report.

2 - 7

Microsoft Official Training Materials for Microsoft Dynamics ®

(14)
(15)

MODULE 3: POS EXTENSIBILITY TECHNICAL

OVERVIEW

Module Overview

This module discusses the Microsoft Dynamics AX 2012 POS extensibility and its operations.

Objectives

The main objective of this module is to help you understand how to customize and extend the Microsoft Dynamics AX 2012 POS. After you complete this course, you will know how to customize and extend POS.

3- 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(16)

Development and Customization

Extend Point of Sale

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

How to customize or extend Microsoft Dynamics AX 2012 POS.

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. It contains two 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.

• 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.

Retail POS Plug-ins

This topic talks about the Retail POS Plug-ins and how to use the Plug-ins to extend or customize the business logic, user interface UI and new operations in POS.

Lesson Objectives

After you complete this lesson, you will know how to customize or extend the Microsoft Dynamics AX 2012 POS.

About POS Plug-ins

Retail POS Plug-ins contains set of services and application triggers. Most of the functionality in Retail POS is implemented by using services. For example, you use

(17)

Module 3: POS Extensibility Technical Overview

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.

By default, Retail POS Plug-ins is installed in the following directory: 1. C:\Users\...\Documents\Retail SDK\POS Plug-ins\

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.

The Microsoft.Dynamics.Retail.Pos.Contracts.dll assembly exposes all the public interfaces to be used for implementing extensions and customizations to the following Retail POS functionality:

• Operations • Services • Triggers

• Commerce Data Exchange: Real-time Service

FIGURE 3.1: POS PLUG-INS

3 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(18)

Development and Customization

Operations

An operation is an activity that occurs in Retail POS. Operations can be a single step or a multi-step. Refer to the POS Framework course document for more information.

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

Interface for Services

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 implement an interface. The developer can make partial or full modifications to the service’s project. Microsoft Dynamics AX 2012 ships with a collection of core services that can be customized or replaced using Retail POS Plug-ins. For descriptions of all the services interfaces that are available in Retail POS, please refer Interfaces for Services"

Triggers

Triggers are events raised by Retail POS that enable you to insert custom code before or after operations. There are two types of triggers:

• Pre-triggers • Post-triggers

(19)

Module 3: POS Extensibility Technical Overview

Interface for Triggers

Triggers are events that are raised by Retail POS that you can use to insert custom code before or after operations. Similar to services, triggers also implement unique interfaces. The developer can use triggers to perform pre-validations and post validations. Each trigger interface has set of methods that can be extended by the developers for customization. Pre-triggers provide an additional 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”.

Commerce Data Exchange: Real-time Service Calls

Retail POS can make real-time calls to Microsoft Dynamics AX 2012 using the Commerce Data Exchange: Real-time Service. This service provides real-time, synchronous communication between Microsoft Dynamics AX 2012 and individual Retail POS terminals.

Lesson Objectives

This lesson helps you understand the real time service functionality of Microsoft Dynamics AX 2012 POS.

Real-time Service Calls

Retail POS uses real-time service calls to start Retail POS functionality, such as Issue Gift Card or Create Customer. You can create custom, real-time service functionality in Retail Headquarters and call it from Retail POS.

3 - 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(20)

Development and Customization

Module Review

Module Review and Takeaways

• Understand how to extend Retail POS • Retail POS Plug-ins Operations

• Services, Triggers and Real-time services

Tools

• Use Visual Studio 2010 Ultimate or a more recent version to customize Microsoft Dynamics AX 2012 POS.

• To customize the Real-time service use in HQ, use the Morphx development suite.

Test Your Knowledge

Test your knowledge with the following questions. 1. What is Retail POS Plug-ins?

2. When do you use POS Plug-ins?

3. What are the two main components of Retail POS Plug-ins? 4. When should Real-time services be used?

(21)

Module 3: POS Extensibility Technical Overview

Test Your Knowledge Solutions

MODEL ANSWER:

1. Retail POS Plug-ins contain sets of services and application triggers to extend POS

2. To extend or customize POS 3. Services and Triggers

4. Any real-time, synchronous communication between Microsoft Dynamics AX 2012 and individual Retail POS terminals like Gift card, loyalty

5. Services contains the core business logic whereas triggers are events raised by Retail POS that enable you to insert custom code before or after operations.

3 - 7

Microsoft Official Training Materials for Microsoft Dynamics ®

(22)
(23)

MODULE 4: POS FRAMEWORK

Module Overview

This module explains the POS technical architecture. This module also provides information about the different components in the POS framework

Objectives

The main objective of this module is to help understand the POS technical framework, its components and other retail components it uses.

4 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(24)

Development and Customization

POS Architecture Overview

This course provides information about the different POS architecture components that include the following:

• POS Core

• CDX: Real time service and Synch service • POS Database

POS Architecture

The POS Architecture consists of the POS Core components.

(25)

Module 4: POS Framework

POS Core

The POS core is the focal point of POS that interacts between the POS user interface (UI), and the POS data layer, services and triggers.

The key components of the POS core include the following: • Operations

• Transaction • SystemFramework • SystemeSettings

• DataAccess (Data Layer) • Contracts

The components in the POS core are not extensible.

FIGURE 4.2: POS COMPONENTS

4 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(26)

Development and Customization

Operations

An operation is an activity that occurs in Retail POS. Operations can be a single step, or a multi-step. For example, Add Item adds a sales line to the current transaction. The Customer add operation presents a form for a cashier to enter customer information. After data is entered and the form is closed, the customer information is sent to Retail Headquarters.

Microsoft Dynamics AX 2012 includes a collection of core operations that cannot be modified. However, you can create new functionality by using the

BlankOperations. You can use Blank Operations to extend Microsoft Dynamics AX for Retail POS by adding custom logic to the Retail POS register buttons. In the Retail POS register, you can add the blank operation button to the POS layout and link it with your custom operations.

Transaction

The transaction dll contains the core transaction classes and Interfaces that are used in standard and extended components. Most POS operations will have the POS transaction passed as parameters that are during the operation.

System Framework:

This dll contains the transaction service. This service is a direct start to Headquarters (HQ).

System Settings:

This dll contains all the settings that are related to connection details, operator details, terminal details, store details, transaction service details, hardware profile, functionality profile and other Application details that can be used while

extending POS.

Data Access:

This dll acts as a data layer between the application and the POS database. It provides a set of interfaces and, or classes that are used in standard operations, services and triggers.

Contracts

The contracts dll contains interfaces that are used across multiple core and extended components of Point of Sale. When POS Plugins are installed, this dll is included as part of plugin code. When you extend a service and, or triggers, add

(27)

Module 4: POS Framework

POS Extensibility

POS Extensibility points give the user the option to extend the POS for custom requirements. The key components include the following:

Services Forms

Although third-party components from the DevExpress libraries were used to build the POS application, you do not have to be familiar with how to set up a development environment by using the DevExpress libraries.

All Windows forms in POS are developed by using the "DXExperience Winforms" product that is created by DevExpress. However, you must have a DevExpress license to modify the design-time visual changes to existing forms. Although you are not required to have DevExpress tools to create new POS forms, it is

recommended that you use them to have a consistent appearance with the rest of the product.

Microsoft Dynamics AX 2012 R2 POS introduces a new way to customize forms by using the Interaction service. Multiple developers can customize one or more forms in one service. If there are multiple customizations, the Interaction service loads only the first customization it finds for a form. The following list of forms uses this new pattern and their implementations are included in the

InteractionDefaults service. • ExtendedLogOnForm • ExtendedLogOnScanForm • frmBarcodeSelect • frmDimensions • frmInput • frmPayCash • frmPayCurrency • frmPayCustomerAccount • frmReturnTransaction • LogbookForm • LogOnForm • ManagerAccessForm • RegisterTimeForm • ViewTimeClockEntriesForm • ProductDetailsForm • ProductInformationForm 4 - 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(28)

Development and Customization

Skins:

By using the DevExpress SkinEditor program, you can change the appearance of Microsoft Dynamics AX for Retail POS registers by creating new Retail POS skins. To create new Retail POS skins, you must obtain a license from DevExpress. Retail POS uses DXExperience Winforms that is created by DevExpress. You can develop your own forms without having to use DevExpress. However, it is recommended that you use these to maintain a consistent appearance.

CDX: Real-time service

Retail POS can make real-time calls to Microsoft Dynamics AX 2012 by using the Commerce Data Exchange: Real-time Service. This service provides real-time, synchronous communication between Microsoft Dynamics AX 2012 and individual Retail POS registers.

Retail POS uses real-time service calls to provide some Retail POS functionality, such as Issue Gift Card or Create Customer. You can create custom, real-time service functionality in Retail Headquarters and call it from Retail POS.

In Retail R2 the Real-time Service changed from a Windows Service to an IIS Web Service. It acts as a traffic handler between the POS and Headquarters to share real-time information. All actual logic is written in X++ code that is hosted in the Application Object Server (AOS) and accessed through the .Net Business

Connector. This change in architecture means that the installation and

configuration includes many changes. Refer to the installation guide to set up the new real time service.

(29)

Module 4: POS Framework

FIGURE 4.3: REAL-TIME SERVICE

CDX: Synch Service (Retail Store Connect)

Commerce Data Exchange: Synch Service is a service that shares data among retail components. These components include the head office, stores, and individual point of sale (POS) terminals. When you install Synch Service, the Retail Salt Utility and Retail Scheduler are also installed. The Retail Salt Utility provides additional encryption for the passwords and credentials that are associated with the Retail system. Retail Scheduler is used to manage the distribution of data between the head office and the stores

4 - 7

Microsoft Official Training Materials for Microsoft Dynamics ®

(30)

Development and Customization

FIGURE 4.4: CDX SYNCH SERVICE

POS Database

This lesson explains about the POS store database and offline database.

Lesson Objectives

• Store Database • Offline Database

• Retail Offline Synch Service

Store Database

Store database is a central database that is inside a store. Typically, a store

database is hosted on a shared server that is connected to all the POS terminals in the store. Multiple POS computers in a store can connect to the same store database.

(31)

Module 4: POS Framework

Offline Database:

Together with the store database, you can also create the offline database on the POS terminal. This helps make sure that the store operation can continue even if the connection to the shared database (store database) is lost.

Retail Offline Synch Service:

The shared database and the offline databases are kept in sync by Microsoft Dynamics AX for Retail Offline Sync Service. This Windows service will run in the POS computer and synch the data between the shared database and the offline database.

4 - 9

Microsoft Official Training Materials for Microsoft Dynamics ®

(32)

Development and Customization

Module Review

Module Review and Takeaways

• POS Architecture • POS Core

• CDX : Real time service and Synch service • POS Database

Test Your Knowledge

Test your knowledge with the following questions.

1. What are the main components of the POS architecture? 2. What is the POS Core?

3. How is the Transaction library used? 4. How is the CDX Synch service used?

5. Which service synchs the data between the store database and the offline database?

(33)

Module 4: POS Framework

Test Your Knowledge Solutions

MODEL ANSWER:

• POS Core, CDX Real-time service, CDX Synch service and store database

• The POS core is the focal point of the POS that interacts between the POS UI and the POS data layer.

• The dll transaction contains the core transaction classes and the Interfaces that are used in standard and extended components. Most POS operations will have the POS transaction passed as parameters, which are used during the operation.

• Retail offline synch service.

4 - 11

Microsoft Official Training Materials for Microsoft Dynamics ®

(34)
(35)

MODULE 5: DEVELOPMENT ENVIRONMENT

REQUIREMENTS

Module Overview

This module will explain the development environment requirements.

Objectives

• Explain the development environment requirements.

5 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(36)

Development and Customization

Development Environment Requirements

System Requirements

The development environment that is shown the following table assumes that all the components are installed in single box. If you are installing each component on different boxes, then refer to the “AX2012 System Requirements” document for detailed information.

Components Requirements

Operating System Windows Server 2012 Standard Edition or Datacenter

Edition

Windows Server 2008 R2 Standard Edition, Enterprise Edition, Web Edition, or Datacenter Edition

Windows Server 2008 Standard Edition, Enterprise Edition, Web Edition, or Datacenter Edition, with Service Pack 2 (Only 64-bit versions of Windows Server 2008 are supported)

Processor Intel Pentium/Celeron family or a compatible Pentium III Xeon or larger processor. We

recommend a processor speed of 1.1 GHz or larger.

Important:

Microsoft Dynamics AX is not supported on Itanium 64-bit processors.

RAM We recommend 4 GB or more of RAM for server computers.

(37)

Module 5: Development Environment Requirements

Software Requirements

Components Requirements Notes

Application Object Server (AOS)

NET Framework 4.0, with the hotfix from Knowledge Base article 2390372,

(http://support.microsoft.com/kb/239 0372).

SQL Server 2008 Native Client

Install SQL Server Native Client on the AOS server if the AOS server is separate from the database server.

You must install the SQL Server 2008 version of the Native Client, even if you are using SQL

Server 2012.

AX Client .NET Framework 4.0

Debugger No additional software requirements

Visual Studio and Tools Windows PowerShell 2.0 Visual Studio 2010, Professional Edition, Premium Edition,

Ultimate Edition, or Team Edition, with Service Pack 1

Visual Studio 2012 can be installed side by side with Visual Studio 2010. However, Visual Studio 2012 is not supported for Microsoft Dynamics AX development.

.NET Business Connector No additional software requirements

5 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(38)

Development and Customization

Components Requirements Notes

Database Microsoft SQL Server 2012, Standard

Edition,

Enterprise Edition, or Business Intelligence Edition. Service Pack 1

(http://www.microsoft.com/enus/dow nload/details.aspx?id=35575) is supported. However, it is not required. –or–

SQL Server 2008 R2, Standard Edition, Enterprise Edition, or Datacenter Edition. Service Pack 1

(http://www.microsoft.com/download /en/details.aspx?id=26727) and Service Pack 2 (http://www.microsoft.com/enus/dow nload/details.aspx?id=30437) are supported.

Service Pack 1 is required if you are installing

Reporting Services extensions. –or–

SQL Server 2008, Standard Edition or Enterprise Edition, with Service Pack 1. Service Pack 3 is supported. However, it is not required. By default, SQL Server 2012 is supported with Microsoft Dynamics AX 2012 R2. To use SQL Server 2012 with an earlier version of Microsoft Dynamics AX 2012, you must install Microsoft Dynamics AX hotfix 2680186 (https://mbs2.microsoft.c om/Knowledgebase/KBDi splay.aspx?scid=kb;en-us;2680186).

Only 64-bit versions of SQL Server are supported. For the minimum

hardware requirements for SQL Server, see

http://www.microsoft.com /sql/default.mspx. In a production environment, we recommend that you install the latest

cumulative update for the version of SQL Server that you are using.

The Retail module in Microsoft Dynamics AX, Retail POS, Commerce Data Exchange: Synch Service and Real-time service, Retail Store Database Utility and Retail SDK

Application Object Server (AOS), OS and other components are mentioned earlier in this document.

(39)

MODULE 6: TECHNICAL BACKGROUND

Module Overview

This module provides information about the knowledge required to customize POS

Objectives

• Understand the knowledge required to customize the POS

6 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(40)

Development and Customization

Technical knowledge required to customize POS

In this lesson we will understand the technical knowledge required for the developer to customize POS.

Microsoft .Net framework

The developer should have basic knowledge on .net framework and advanced knowledge on C#. Retail POS is developed using C#, and thus knowledge in c# is mandatory.

POS Functionality

The developer should have a basic understanding of POS processes and functionality to extend or customize POS. Please refer POS functional training document (AX2012 ENUS_RTL) for more information.

SQL Server 2008 or higher version

Basic knowledge on SQL Server is required to customize POS because we will be creating or modifying the tables, stored procedures for POS

Retail HQ Setup and Configuration

It is preferable to have knowledge on HQ Retail setup (Distribution schedule) and configuration like CDX sync and real time services to quickly diagnose the problem and issues.

Knowledge on X++

Basic knowledge on x++ is required to customize or extend CDX Real-time service.

(41)

MODULE 7: LOCALIZATION INFORMATION

Module Overview

This module provides information about how to localize Point of Sale (POS) by changing the POS labels and strings.

Objectives

• Explain the requirements that are used to change POS labels and strings.

7 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(42)

Development and Customization

POS Localization

Localization is the process of adapting software to meet country-specific laws or regulations. Microsoft localizes Microsoft Dynamics AX to include features and functionality designed to address specific tax, accounting or financial reporting requirements for various countries.

Languages

Translation is the process of adapting software or documentation to meet language requirements for a particular country. For any given language, Microsoft may translate some, all or none of the user interface (UI) and documentation for Microsoft Dynamics AX.

To set up POS in specific language, go the respective Retail Channel and change the retail channel language. We can change the language in AX Retail by navigating to Retail->Common->Retail channels->Retail stores->Language

FIGURE 7.1: SET UP POS IN SPECIFIC LANGUAGE

A very common requirement to localize the POS in Dynamics AX for Retail is to change the wording of the strings and labels in the product. In this lesson we will learn how to do that.

(43)

Module 7: Localization Information

POS Labels and Strings

Nearly every string that is used in the product resides in the

POSResources.resources.dll file in the POS folder. The English (en-us) version of this file is in the root folder, and then we have one for all of the localized translations: fi\POSResources.resources.dll, fr\POSResources.resources.dll, etc. When the POS application needs a string, it checks in the following places in the order listed:

• The dbo.RetailLanguageText table in the POS database

• The POSResources.resources.dll file for the language currently being used

When a string is found, it gets cached for the remainder of the POS instance lifetime. As a developer, this means that you cannot manipulate the strings at runtime – any changes that are made to the table do not get reflected until the next time the app is started.

Change/Add POS Labels and strings

To change the text of an existing label or string, we need to populate three columns in the RETAILLANGAUGETEXT table: LANGUAGEID, TEXTID, and TEXT (the remaining columns are deprecated and are no longer used in the product). LANGUAGEID and TEXT are the language Id in AX and the actual text to be displayed in POS. But to get the TEXTID we can follow the below step:

Modify the POS shortcut and append a ‘-tr’ as a command-line argument, POS will run in a special developer mode where each string and label is prepended with the TEXTID. This will allow you to find exactly which strings and labels match up with which ID.

7 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(44)

Development and Customization

(45)

Module 7: Localization Information

FIGURE 7.3: OPERATOR ID

Find the ID of the string that you want to change and then add the new text to the RetailLanguageText table with ID you of the string you want to change. Since there is no form for adding strings to the RetailLanguageText table, we will populate the values directly in the AOT. Open a new developer workspace and navigate to Data Dictionary > Tables > RetailLanguageText. Right-click and select Open. Create a new records by populating the languageID, Text and textID fields:

7 - 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(46)

Development and Customization

FIGURE 7.4: EMPLOYEE ID

Also use the RETAILLANGUAGETEXT table for any strings that you create from scratch. The Blank Operation sample plug-in uses 50700 as a starting number; that number through 50700-50999 are currently un-used. We can use the number between these series for our custom strings. Please make sure that TextID is not conflicting with strings from other developers or possibly by future versions of the product.

Once you’ve added your strings to the table, you can use this method to grab strings from the table.

(47)

Module 7: Localization Information

Module Review

Module Review and Takeaways

• Understand how to change POS Strings and labels

Test Your Knowledge

Test your knowledge with the following questions.

1. What is the command parameter used to launch POS in special mode which displays the label ids?

2. In which table the POS custom strings and labels are stored? 3. Which library stores all the POS labels and string resources?

7 - 7

Microsoft Official Training Materials for Microsoft Dynamics ®

(48)

Development and Customization

Test Your Knowledge Solutions

MODEL ANSWER:

1. -tr

2. RETAILLANGUAGETEXT table 3. POSResources.resources.dll

(49)

MODULE 8: EXTENSIBILITY BEST PRACTICES

Module Overview

AX Retail POS (Point of Sales) is a .Net solution which is available as part of AX Retail installation. The SDK will be available for the implementation team to customize further as per the specific customer’s requirement. With the SDK we can customize the POS services and Triggers only.

This document provides general guidelines on how to customize the Retail solution and overall solution approach for the POS Retail part. As this is on .Net, .Net specific coding guidelines will be applicable by default.

Objectives

• Provide best practices and guidelines/standards for Retail POS customization.

8 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(50)

Development and Customization

Solution Approach

There are two primary approaches for POS customization. These are: 1. Greenfield Development

2. Brownfield Development

Greenfield Development

The Greenfield approach for adding customizations on POS is to implement the customization in default interfaces provided by the plugins. Then Replace the OOB DLL provided by the Retail POS installation with the custom DLL. For example, in order to customize the Sales Order service, load the services solution form the Retail POS SDK(By default the SDK path will be

C:\Users\...\Documents\Retail SDK\POS Plug-ins\) folder and extend it by adding the new classes and methods within the same SalesOrder project.

Brownfield Development

In brownfield development style, partial classes are used to keep customized code separate from the OOB plugins code.

The advantages of using partial classes is that

• Customized code resides in a separate file rather than existing plugin code file which help in code merging during the hotfix deployment and we will have the clear separation of code between the

customization and OOB Retail SDK.

• In future, if there are any upgrades or hot fixes release, developers can make those changes to OOB Plugin code by comparing it with the new updates in code, while customized code can be demarked clearly

• During operations lifecycle of the system, you can more easily find if the issue belongs to OOB Plugin code or it is customized code In all Retail implementation of AX, each customer will have a specific requirement for authorizing credit card payments. To do that, developer will have to modify the EFT class provided in the EFT Project. To incorporate this change, follow the below steps:

(51)

Module 8: Extensibility Best Practices

Create a new C# file

Taking the Credit card Payment Processing scenario, create a new file called _EFT.cs in the EFT project, as shown in the figure below.

Modify the class declaration and namespace

In the new class file created,

• Rename the class declaration to partial class; in the current scenario, it will be “public partial class EFT : IEFT”

• Rename the namespace to match the OOB class, which in the current scenario, will be “namespace EFT”

• Copy namespaces from OOB class, to the new class file

• Implement new methods or comment the existing methods in the OOB class and implement it as required in the new partial class.

In

the

OOB file class,

• If the class is not partial class, rename the class declaration to partial; in the current scenario, it will be “public partial class EFT: IEFT”

Source Code Control

Source code control gives you the benefits of versioning, tracking and reverting back to earlier versions. If you are part of a team customizing POS, automated source code control provides a significant advantage. When many people work together to create, support, and update source code files for POS, the

coordination of files and updates is a complex process. Team Foundation Server (TFS) provides stable, easy-to-use source code management to keep the team's developers in sync with each other's changes.

Solution Configuration

When setting the solution in TFS, the delivery team must configure the complete Services and Triggers solution in TFS. While configuring the Services or Triggers solution, proper version of the AX Retail POS version must be chosen (AX 2012 R2)

From the Services or Triggers solution, the project specific solution must be configured as a branch from the main application. By doing this, we are keeping the original source code as is in the main solution and keep only the project specific code in the branch

8 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(52)

Development and Customization

The projects which we are not used for customization from the Retail SDK can be removed from the TFS branch. In this way, the delivery team will be focused only on the items they will be modifying and delivering to the customer. The solution available in the branch should comply with the coding standards of .Net like FxCop, StyleCop, VS Code analysis and Code metric standards. For detailed information on these standards please refer the link in the reference section.

TFS for Version control .NET solution

Daily builds

Use Release version of the dlls’ for deploying to testing, Staging and Production environments

Unit Testing

It is usually conducted by the development team. This testing is to verify and validate that the individual units of source code are fit for use.

Considerations:

• The ability of the system to properly process erroneous transactions • systems or components pass data and control correctly to one

another

Using Test Driven Development (TDD) developer can write unit test cases for solution before actually writing that code. By writing a test and then writing the code to make that test pass developers have a much better idea of what the goal and purpose of the code is. Also, a TDD comprehensive suite of unit tests can be run at any time to provide feedback that the software is still working. It improves the quality of code and ensures total code coverage of custom code. The

developer can use Visual T#, NUnit, MS Test, xUnit or any other viable unit test framework for TDD driven unit testing. For detailed information on the unit testing please refer the link in the reference section

(53)

Module 8: Extensibility Best Practices

Reference

Partial Classes and Methods (C# Programming Guide) -

http://msdn.microsoft.com/en-us/library/wa80x488(v=VS.100).aspx

AX for Retail: A Better Sample for EFT plug-in (Credit Card processing)

http://blogs.msdn.com/b/axsupport/archive/2012/01/14/ax-for-retail-a-better-sample-for-eft-plug-in-credit-card-processing.aspx

C# coding guidelines

http://msdn.microsoft.com/en-US/library/vstudio/ms229042(v=vs.100).aspx

Guidelines for Test-Driven Development

http://msdn.microsoft.com/en-us/library/aa730844(VS.80).aspx

Test Driven Development

http://msdn.microsoft.com/en-us/library/aa730844(v=vs.80).aspx

Visual Studio 2010: Test Driven Development

http://msdn.microsoft.com/en-us/gg454254 FxCop http://msdn.microsoft.com/en-US/library/bb429476(v=vs.80).aspx Code analysis http://msdn.microsoft.com/en-us/library/3z0aeatx.aspx StyleCop http://archive.msdn.microsoft.com/sourceanalysis Code Metrics: http://msdn.microsoft.com/en-us/library/bb385914.aspx 8 - 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(54)

Development and Customization

Module Review

Best Practice:

1. Follow C# coding guidelines

2. Follow FxCop and StyleCop standards 3. Enable static code analysis in VS 4. Follow the below code metrics:

Maintainability Index per method > 20 Cyclomatic Complexity per method <= 20 Class Coupling per class or type <= 20 Depth Of Inheritance per class or type <= 6 Lines of code per method <= 40

Test Your Knowledge

Test your knowledge with the following questions. 1. What is Greenfield development

(55)

Module 8: Extensibility Best Practices

Test Your Knowledge Solutions

MODEL ANSWER:

1. In Greenfield approach all the customization is done in new classes or projects and added as reference

2. In Brownfield approach customizations are done in partial classes.

8 - 7

Microsoft Official Training Materials for Microsoft Dynamics ®

(56)
(57)

MODULE 9: LOGON EXTENSIBILITY – SAMPLE AND

HOW-TO

Module Overview

In this module we will learn how to extend POS Logon functionality and support for using any external device for logon like Biometric devices.

Objectives

• Understand how to extend POS Logon functionality.

9 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(58)

Development and Customization

Logon Extensibility

This lesson provides brief information about the POS Logon extensibility feature using some external devices or any other mediums.

Extending Logon by using Biometric devices:

Dynamics AX Retail 2012 R2 POS allows ISVs to use biometric device for logon. Following interface must be implemented by POS plugin:

FIGURE 9.1: BIOMETRIC DEVICE FOR LOGON INTERFACE

Following the typical sequence for POS logon follow and call into the biometric plugin

(59)

Module 9: Logon Extensibility – Sample and How-To

FIGURE 9.2: SEQUENCE FOR BIOMETRIC PLUGIN

Steps to implement biometric logon:

1. Implement following interface in a new POS logon plugin assembly. Microsoft.Dynamics.Retail.Pos.Contracts.Services.IBiometricDevice 2. Copy the POS plugin and related assemblies to the \Extensibility

directory under your POS directory. 3. Launch POS

4. Go to ‘Extended Log on’ operation and click assign on any staff to enroll for biometric logon.

The sample provides information on how to extend the logon functionality in POS to use Biometric devices.

9- 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(60)

Development and Customization

Biometric Plugin

The below code provides the abstract for implementing the Biometric plugin. We can extend this code to implement biometric login in POS.

public sealed class BiometricPlugin : IBiometricDevice {

public event BiometricDeviceDataEventHandler DataReceived; public event BiometricDeviceStatusEventHandler StatusUpdate; public void Load()

{

// Init the biometric device }

public void Unload() {

// Cleanup }

public string DeviceName {

get { return string.Empty; } }

public string DeviceDescription {

get { return string.Empty; } }

public bool IsActive {

get { return true; } }

public void BeginEnrollCapture() {

// Create worker thread for enroll capture and return }

public void BeginVerifyCapture() {

// Create worker thread for verify capture and return }

public void EndCapture() {

// close the thread. }

(61)

Module 9: Logon Extensibility – Sample and How-To

public string Identify(IExtendedLogOnInfo captureData,

ICollection<byte[]> candidates) {

string logOnKey = null;

// Identify the give capture data from given cadidates and return hash (e.g. MD5 HASH) of found cadidate.

return logOnKey; }

}

9- 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(62)

Development and Customization

Module Review

Module Review and Takeaways

• Understand how to extend Log on functionality in POS

Test Your Knowledge

Test your knowledge with the following questions.

(63)

Module 9: Logon Extensibility – Sample and How-To

Test Your Knowledge Solutions

MODEL ANSWER:

1. LogOn

9- 7

Microsoft Official Training Materials for Microsoft Dynamics ®

(64)
(65)

MODULE 10: POS THEMES

Module Overview

In this module you will understand how to change the look and feel of 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 created by DevExpress. You can develop your own forms without using DevExpress, but it is recommended you use these to maintain a consistent look and feel.

Objectives

• Understand how to create or modify existing Retail POS Skins

10 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(66)

Development and Customization

POS Skins

Creating a new skin

• Go to the SkinEditor tool, which is typically found at <root>\Program Files (x86)\DevExpress 2011.2\Components\Tools\Windows Forms (where 2011.2 is the version number of the product). Double-click the SkinEditor icon to launch the tool.

• Click File->New to open the New Project window.

FIGURE 10.1: NEW PROJECT WINDOW

• Set the Project Name to MyFirstCustomSkin.

• Change the Template Skin: field from DevExpressStyle to Office 2010 Blue using the dropdown arrow.

• Set the Skin Name: to MyFirstCustomSkin and click the OK button. Your new skin project is now loaded within the SkinEditor tool, which contains a list of UI elements called Products. For the remainder of

(67)

Module 10: POS Themes

FIGURE 10.2: CUSTOM SKIN WINDOW

Setting color properties on your new skin:

• Select the common property from the SkinEditor Tool

FIGURE 10.3: SKIN EDITOR TOOL

10 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(68)

Development and Customization

• Set the Common > Control color property to Blue. • Set the Common > ControlText color property to White. • Click File->Save.

• You must now convert your project into an assembly that will be used by Retail POS. Click File->Create Assembly. You should see a

confirmation dialog similar to the following:

FIGURE 10.4: ASSEMBLY GENERATED INFORMATION WINDOW

The newly generated skin assemblies are placed in the

<root>:\Users\<username>\Documents\My DXSkins\ directory. There will be a folder beneath that directory with the same name as your skin, in this case MyFirstCustomSkin. Inside that folder, you will find a MyFirstCustomSkin.dll.

Launching Retail POS with your new skin:

In order for Retail POS to load your new skin, you must place the skin assembly in the Retail POS runtime folder. Copy the MyFirstCustomSkin.dll to the Skins folder underneath the Retail POS runtime directory.

You also need to make Retail POS aware of your new skin.

Using Commerce Data Exchange: Synch Service

• Open Microsoft Dynamics AX for Retail Headquarters and go to Retail->Setup->POS->Profiles->Visual Profiles.

• Right-click the Theme dropdown and click View Details. • Click the New button and set the POS skin name field to

(69)

Module 10: POS Themes

• Go to Retail->Periodic->Data Distribution->Distribution Schedule. Select the N-1090 job and then click the Run directly button. This will synch the new skin to Retail POS. You can run the following query against the AXRetailPOS database to make sure this procedure worked:

SELECT POSSKINNAME, * from RetailVisualProfile

• Launch Retail POS and your new skin’s visualization effects should display similar to the following image.

FIGURE 10.5: SKIN VISULATION EFFECTS DISPLAY

10 - 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(70)

Development and Customization

Module Review

Tools

DevExpress SkinEditor Tool.

Test Your Knowledge

Test your knowledge with the following questions.

(71)

Module 10: POS Themes

Test Your Knowledge Solutions

Module Review and Takeaways

1. How will you update the new skin created using the tool in POS MODEL ANSWER:

• In order for Retail POS to load your new skin, you must place the skin assembly in the Retail POS runtime folder. Copy the

MyFirstCustomSkin.dll to the Skins folder underneath the Retail POS runtime directory. Also update the new skin name in Retail->Setup->POS->Profiles->Visual Profiles and run the N-1090 scheduler job.

10 - 7

Microsoft Official Training Materials for Microsoft Dynamics ®

(72)
(73)

MODULE 11: USER-INTERFACE EXTENSIBILITY –

SAMPLE AND HOW-TO

Module 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 loads 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.

11 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

(74)

Development and Customization

How to Modify a Form in Microsoft Dynamics AX 2012

R2 POS

This lesson explains how to modify the Microsoft Dynamics AX 2012 R2 POS forms in Interaction service and other services forms.

Lesson Objectives

• Explain how to customize a form by using the InteractionDefault service.

• Explain how to customize forms in POS Plugins without using the InteractionDefault service.

Customizing Forms by Using InteractionDefault Service

The following list of forms use this new pattern and their implementations are included in the InteractionDefaults service.

• ExtendedLogOnForm • ExtendedLogOnScanForm • frmBarcodeSelect • frmDimensions • frmInput • frmPayCash • frmPayCurrency • frmPayCustomerAccount • frmReturnTransaction • LogbookForm • LogOnForm • ManagerAccessForm • RegisterTimeForm • ViewTimeClockEntriesForm • ProductDetailsForm • ProductInformationForm

(75)

Module 11: User-Interface Extensibility – Sample and How-To

To customize an interaction form, follow these steps.

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.

3. To change the background color, right-click the LoOnForm.cs from

InteractionDefuslt project and select View Code.

4. Add the following code to the OnLoad() method for the first line of the method to change the back ground color to dark red.

Sample code to change the form background color

((Form)this.BackColor = Color.DarkRed;

5. Compile the InteractionDefaults project. 6. Copy the new assembly to the

Pos\Services\InteractionDefaults\Extension folder and start Retail POS. The LogOnForm should resemble the following:

FIGURE 11.1: OPERATOR ID WINDOW

11 - 3

Microsoft Official Training Materials for Microsoft Dynamics ®

(76)

Development and Customization

How to Modify a Form in the Microsoft Dynamics Ax 2012

R2 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 user interface (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.

To customize the ItemSearch form, follow these steps.

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.

1. 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.

2. Open the Services folder and double-click the Visual Studio solution file, services.sln.

3. Open the Services folder and double-click the Services Visual Studio

solution file.

4. Click the Dialog project and expand the WinFormsTouch Folder. Click frmItemSearch.cs and select view code. To modify the forms, you must have a DevExpres license.

5. Add the following code in the variable declaration section of the frmItemSearch class to declare the new column.

private DevExpress.XtraGrid.Columns.GridColumn colSearchString;

6. Initialize the column in InitializeComponent() method.

this.colSearchString = new evExpress.XtraGrid.Columns.GridColumn();

7. 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,

(77)

Module 11: User-Interface Extensibility – Sample and How-To

//

// 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;

8. Now, modify the Item Search query to include the new column in the search criteria for filtering and displaying 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);

9. 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.

10. 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.

11 - 5

Microsoft Official Training Materials for Microsoft Dynamics ®

(78)

Development and Customization

(79)

MODULE 12: TRIGGER EXTENSIBILITY – SAMPLE

AND HOW-TO

Module 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.

Objectives

• Explain how to extend triggers in Microsoft Dynamics AX 2012 R2 POS.

12 - 1

Microsoft Official Training Materials for Microsoft Dynamics ®

References

Related documents