0% found this document useful (0 votes)
111 views6 pages

11 User-Interface Extensibility Sample and How To

11 User-Interface Extensibility Sample and How To

Uploaded by

ms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views6 pages

11 User-Interface Extensibility Sample and How To

11 User-Interface Extensibility Sample and How To

Uploaded by

ms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

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.

Microsoft Official Training Materials for Microsoft Dynamics


Your use of this content is subject to your current services agreement

11 - 1

Microsoft Dynamics AX 2012 R2 For Retail in Brick and Mortar Stores 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.

11 - 2

ExtendedLogOnForm

ExtendedLogOnScanForm

frmBarcodeSelect

frmDimensions

frmInput

frmPayCash

frmPayCurrency

frmPayCustomerAccount

frmReturnTransaction

LogbookForm

LogOnForm

ManagerAccessForm

RegisterTimeForm

ViewTimeClockEntriesForm

ProductDetailsForm

ProductInformationForm

Microsoft Official Training Materials for Microsoft Dynamics


Your use of this content is subject to your current services agreement

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

Microsoft Official Training Materials for Microsoft Dynamics


Your use of this content is subject to your current services agreement

11 - 3

Microsoft Dynamics AX 2012 R2 For Retail in Brick and Mortar Stores 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,
this.colItemTaxRate,
this.colItemOwnThirdProduc,
this.colItemRoundTrunc});

11 - 4

Microsoft Official Training Materials for Microsoft Dynamics


Your use of this content is subject to your current services agreement

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.

Microsoft Official Training Materials for Microsoft Dynamics


Your use of this content is subject to your current services agreement

11 - 5

Microsoft Dynamics AX 2012 R2 For Retail in Brick and Mortar Stores Development and Customization

FIGURE 11.2: PRODUCT SEARCH WINDOW

11 - 6

Microsoft Official Training Materials for Microsoft Dynamics


Your use of this content is subject to your current services agreement

You might also like