Saturday, July 11, 2015

Easily move Retail Till Layouts between environments

Many of the times we would like to see the Till layout in our Live environment on our Testing instance. The usual way would be to replicate manually the changes on the Till layout designer one by one or move the complete transaction DB from Live to Testing instance. Both of which will give a lot of downtime or a bit cumbersome! A easy hack to replicate the details would be to just copy over all the relevant tables via SQL insert. I had went through the table relationships and have compiled the necessary ones which you can use for the copy functionality. The data for design is predominantly saved as XML data which is used by the .NET runtime on POS for building the layout or an activeX component for designer in AX which allows for layout changes. At no point you should manipulate the XML data directly as it can make the layout to crash, we need to allow the ActiveX designer to generate the XML data, that's one of the reasons you need to provide additional Read/Write permissions for AX database for the users who manage the Till Layout designs.
The list of tables that are involved in the Till Layouts are,
  • RetailDeviceTypes
  • RetailPOSTheme
  • RetailTillLayoutZone
  • RetailTillLayoutZoneReference

AX 2012 R2 has the first 5 tables as the remaining tables were included in R3 with the introduction of MPOS. And here is the sample SQL Select into statement, please make sure you've moved the records in Testing table to a backup table before executing the statement.

select * into [--TestInstance--].[dbo].[RETAILBUTTONGRID]
 from [--LiveInstance--].[dbo].[RETAILBUTTONGRID] 

Kindly test carefully and evaluate relationships of the tables to be sure there has not been any changes incorporated by Microsoft in version or hotfix changes.