Thursday, March 28, 2013

AX 2012 for Retail: Trace POS calls

One major troubleshooting technique to issues found in the POS where calls are made to the AX AOS is to grab the XML that caused the error and run it in AX to see what the issue is.

On a current project, we were going into the store DB, searching for the RetailLog and finding the call and XML that caused the issue. This is ok to do when working primarily with one store DB. There is some complexity when it comes to working with multiple store DBs though. The user would have to go from store DB to store DB to find the XMLs. That can be a lot of work. Note: For those not familiar, each store needs its own DB and can have multiple terminals. The implementation of each terminal with its own store DB is no longer supported in 2012.
 
One day, a colleague stumbled upon a second alternative. We all looked into it to figure out WTF was going on. There is a way to turn on tracking for calls coming into AX so you can track multiple calls from all the POS's instead of needing to go to all the individual databases. There is something that needs to be setup in a setup file and install some software but I'll discuss those points.

To note, this log file can get very large. I'd recommend not doing this in PROD unless you absolutely have to. It's a good tool in DEV and TEST environments though.
  1. Set the RetailTransactionService XML config file to allow tracing. I've highlighted the change that needs to be set below.
  2. Install (or confirm its installed) the Microsoft SDK
  3. [Run a bunch of RTS transations]
  4. Locate the RTS log .svclog (the RTS service user's AppData\Roaming folder)
  5. Open it with the Microsoft Service Trace Viewer from the Microsoft SDK
  6. Enter filter criteria to see the transactions

Step 1 - Set the RetailTransactionService XML config file to allow tracing. I've highlighted the change that needs to be set below.
Set the switchValue node value to 'All' in the 'RetailTransactionService.exe.config' file in the C:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Transaction Service folder.

Figure 1- the config file
Figure 2 - the config file contents

Step 2 - Install (or confirm its installed) the Microsoft SDK.
The image below shows the 'SvcTraceViewer.exe' file in the C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin folder location.


Figure 3 - The contents of the Microsoft SDK 
Step 4 - Locate the RTS log .svclog (the RTS service user's AppData\Roaming folder)

Figure 4 - The WCF Trace File
Step 5 - Open the .svclog file with the Microsoft Service Trace Viewer from the Microsoft SDK
Figure 5 - The Microsoft Service Trace Viewer (MSTV) program with date begin filter selected
Step 6 - Enter filter criteria to see the transactions and click 'Filter Now'
The data in the svclog file can be filtered by a number of criteria. A few are detailed below. Then clicking the 'Filter Now' button will filter out the data in the log file and present it in the Microsoft Service Trace Viewer.

Figure 6 - 'Search in' filter options 

Figure 7 - 'Level' filter options

Figure 8 - MSTV showing RTS log




No comments:

Post a Comment