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




Tuesday, March 26, 2013

AX Dev Issue: Multiple developers in a single AX environment freezing up


AX allows multiple developers to exist in an AX environment without any issues. I've had up to ten people in a single instance creating all sorts of stuff. There can be some issues with people modifying the same base objects of course but when doing training and creating new processes, everything should be good.

We had an issue with AX 2012 R2 freezing up and stopping anyone from doing anything in the system. The clients would crash and all sorts of nasty things.

Issue was with the database doing an entire system synchronization. One of the developers in the system was doing an unintentional full database sync. From what I could see, when a synchronization occurs, the entire database will lock up from any table Id or sync related problems. People can still compile code and other objects but doing actions like creating a table or changing an EDT would result in a total lock up of the system.

The question 'Is this a bug? Why does this happen' is a fair one. This is all by design and it makes total sense. Imagine if one person was doing a full synchronization and another user came in during that process, added a table and some EDTs and was able to sync them and move on. This process compromised the integrity of the other person's synchronization of the system.

To avoid a full synchronization, when making a change to the system or creating an EDT, the user can be prompted with 'Are you sure you want to synchronize the database' or something close to that. Have the users click 'No' 100% of the time. When adding the EDTs, everything should update properly and we can add them to a table and synchronize those individually (see Figure 1 for that). The user may see the 'Data Dictionary' icon go red. That just means you eventually have to do a full sync. It will not stop testing or let alone a comprehensive unit test. I would before major unit testing to be safe but I don't think its required from my experience (as long as it was fully synced before the dev starting fiddling about) since we're manually synching any changes we manually make.

Figure 1 - Single table synchronization

There were reports that when adding an EDT, the system would automatically perform a full system sync without prompting the user. I have not tied that scenario down yet, but we did clear his usage data, create an EDT with proper name, add the Extends property, add a few other things and not have that happen again. I'm still investigating this...

Helpful hint: I find things are faster dev-wise when doing development in a single tier environment (AX client, AOS, and SQL DB on same machine). It's easy to backup and clone if virtual and the compilation of the code from the AX client to AOS as well calls to metadata provider are reduced

Monday, March 25, 2013

AX Tables: Copy all table data to another table

Sometimes there is a need to copy the data that is in one table into a new table. This can be due to synchronization issues where the data in a table may be lost, just wanting to tinker with the data, or whatever other reason you want. Here is a basic way to do this.
  1. In the development workspace, right click on the table (we will call this daxTable) and select 'Duplicate'. This will create a new table. We will rename this table daxTable_Copy
  2. Copy, paste, and run the below code into an AX job
Note that the recId and recVersion will not come over in this call. If other tables rely on this table's recId, this will screw some stuff up moving the data around.

// Copy data from one dropped table to another
static void daxCopyTableData(Args _args)
{
    DAXTable      daxTable;
    DAXTable_Copy daxTable_Copy;
    ;

    ttsBegin;
    // Clear the data from the copy table
    delete_from daxTable_Copy;

    while select daxTable
    {
        buf2Buf(daxTable, daxTable_Copy);   
        daxTable_Copy.insert();
    }
   
    ttsCommit;
}

Saturday, March 23, 2013

AX 2012 R2 database synchronization error



When doing an install of AX 2012 R2 (clean) we were getting a synchronization error on two tables which were stopping things from proceeding. The two tables were part of the public sector code and were 'ADVANCEDLEDGERENTRYHEADER' and 'ADVANCEDLEDGERENTRYLINE'. The synch error was referencing an index error or some sort.

Issue: The issue was with the SourceDocumentHeaderIdx index on the 'ADVANCEDLEDGERENTRYHEADER' table and the SourceDocumentLineIdx index on the 'ADVANCEDLEDGERENTRYLINE' table. While not 100% sure what the issue was, I'm guessing that the data in the released Contoso demo data was made before the unique index change was put in place. See the missing indexes below in Figure 1.

Figure 1 - The missing indexes causing the issue

Resolution:  There are two possible resolutions that I have confirmed. If you don't care about the data, I'd recommend the first one:
  1.  Delete the two tables in SQL and resynchronize the database
    1. This removes the base data but at least the tables syncs without any modifications to the base AX objects 
  2.  Change the 'Allow Duplicates' property to 'Yes' on the appropriate indexes on those tables.
    1. Not sure what negative things this change will have but it resolves the issue and will retain the base data. I see how things could go wrong in the future but I don't know Public Sector so use this technique at your own risk.
THE ERROR:
Error        Synchronize database        Cannot execute a data definition language command on  ().
The SQL database has issued an error.
Info        Synchronize database        SQL error description: [Microsoft][SQL Server Native Client 10.0][SQL Server]The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.ADVANCEDLEDGERENTRYHEADER' and the index name 'I_12156SOURCEDOCUMENTHEADERIDX'. The duplicate key value is (5637144577, psus).
Info        Synchronize database        SQL statement: CREATE UNIQUE  INDEX I_12156SOURCEDOCUMENTHEADERIDX ON "DBO".ADVANCEDLEDGERENTRYHEADER (PARTITION,DATAAREAID)
Error        Synchronize database        Cannot execute a data definition language command on  ().
The SQL database has issued an error.
Info        Synchronize database        SQL error description: [Microsoft][SQL Server Native Client 10.0][SQL Server]The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.ADVANCEDLEDGERENTRYLINE' and the index name 'I_12157SOURCEDOCUMENTLINEIDX'. The duplicate key value is (5637144577, psus).
Info        Synchronize database        SQL statement: CREATE UNIQUE  INDEX I_12157SOURCEDOCUMENTLINEIDX ON "DBO".ADVANCEDLEDGERENTRYLINE (PARTITION,DATAAREAID)
Error        Synchronize database        Problems during SQL data dictionary synchronization.
The operation failed.
Info        Synchronize database        Synchronize failed on 2 table(s)

Friday, March 22, 2013

Issue with .vdi file virtual PC in Oracle Box stuck in boot loop

I don't know what the hell it is with me and Virtual PCs but I always seem to struggle with getting them running. If its not one thing its another.

Today I saw an issue that I've seen before so I figured I would do a little brain dump of what the issue was for the two things that I've seen. I'm sure there are a million other things that could cause it but it is what it was for me so it should help someone.

A colleague of mine was attempting to start a virtual machine using Oracle Box 4.1.2 (something) and the virtual machine would not boot. It kept saying 'Windows booting' or 'Windows is starting' with a progress bar but never actually getting to boot. I thought this could be an issue with the BIOS settings or something.

We tried the following to no success:
  • Running the image on an external hard drive
  • Running the image on an external hard drive from all ports
  • Compared the configuration start up settings
  • Ran the virtual machine image loaded locally
The first time this happened, it ended up being an issue with image distributed to everyone as being broken somehow. Not sure what the actual problem was but I would check with other people or have them try to run your image as well to isolate the issue to either something with your computer or the image itself. That's how I found out about that issue. You may want to try to copy the image again and try it again if that same virtual image is working on another person's box and the versions and settings are the same.

The issue today was actually due to the version of Virtual Box that the person was running. It seems the newest version of Oracle Box was causing the image to not boot properly. Not sure why this was happening but it seems everyone else could run this image but that one person. He could even run other virtual machines, just not this one specific one.

That being said, how can we get him to run this virtual machine? I couldn't find anything online that allows a user to regress their version of Virtual Box. It seems the only way to solve the issue is to uninstall the current version completely download an older version, and reinstall it. Sure enough, this fixed the issue.

Interesting I'm sure. Sorry there is no explanation into what the issue actually was causing this issue but at least two solutions and some troubleshooting steps are here. We couldn't find anything online so hopefully people like us in the future will stumble on this and save themselves a little frustration.


Thursday, March 21, 2013

AX 2012 Certification Exams list

The below are the AX 2012 certifications that are available. Some are still to be determined (TBD). I've also included the paths to get a MCBMSP (Microsoft Certified Business Management Solutions Professional).

UPDATE 2/11/2015 - The most up to date certifications lists are appended to the bottom of the post.

Personally, I'm not a fan of people who just rack up certifications but don't have any personal experience with the product. I've run into people who try to gain credibility by saying "I have 5 certifications blah blah blah", but when they get down to it, they don't even know how to get around the app... To be fair, when I started in AX, I got a few certifications when I was still in 'college life studying' mentality. A lot of the exams are fairly easy to pass as long as you are book smart and spend the time on it.

That being said, I think being book smart gave me a huge leg up when it came to actually executing things. Just don't tote them like you're an expert if you're not because you'll be sized up quick...  I'd also recommend all DEVs do an application exam like Financials or T&L and all FUNCs do a development exam. Nothing is better to have on your team than a person who can communicate in both realms.

Microsoft Dynamics AX Certification Exam Preparation Guides

Not scheduled to be released for AX 2012 (from what I could tell): 
  • Enterprise Portal Development
  • Human Resources Management
  • Product Builder
  • Service Managmenet
If you are interested in getting a MCBMSP next to your name, you can do that by following three specialization paths below.

NOTE: The issue is that a lot of the 'Elective Exams' do not exist for AX 2012. To become certified as a Microsoft Certified Business Management Solutions Professional, you must successfully complete the exams that are based on the current version of the product or you must successfully complete the most recent version of the exams. So you may need to jump versions of AX. I'd recommend holding out for some of the TBD exams instead of getting 2009 unless you already have experience in them so the certs are up to date longer.

Microsoft Certified Business Management Solutions Professional - Application for Microsoft Dynamics AX
  • Core Exams (1 exam required)
    • Financials (AX 2012)
  • Elective Exams (3 exams required)
    • Production (AX 2009 until 2012 is released)
    • Trade & Logistics (AX 2012)
    • Product Builder (AX 2009)
    • Microsoft Business Solutions Axapta Sales & Marketing
    • Human Resources Management (AX 2009)
    • Questionnaire (AX 4.0 - good luck finding it)
    • Project Series (AX 2009 until 2012 is released)
    • Microsoft Business Solutions Axapta Shop Floor Control (AX 4.0 - good luck finding it)
\Microsoft Certified Business Management Solutions Professional - Developer for Microsoft Dynamics AX
  • Core Exams (2 exams required)
    • Development introduction (AX 2012)
    • MorphX Solution Development (AX 2009 until AX 2012 is released)
  • Elective Exams (2 exams required)
    • Financials (AX 2012)
    • Enterprise Portal Development (AX 2009)
    • Production (AX 2009 until 2012 is released)
    • Installation & Configuration (AX 2012)
    • Trade & Logistics (AX 2012)
Microsoft Certified Business Management Solutions Professional - Installation & Configuration in Microsoft Dynamics AX

Note: Some of the exams below are still officially requiring certifications in SQL 2005 and Windows Server 2003... yes really. I'd assume later SQL releases will apply?? I have not tested this but I think it would be stupid for it not to. If you have experience in this, let me know below in the comments.
  • Core Exams (2 exams required)
    • Installation & Configuration (AX 2012)
    • MS Exam:  TS:  70-431: Microsoft SQL 2005 - Implementation and Maintenance)
  • Elective Exams (2 exams required)
    • Financials (AX 2012)
    • Production (AX 2009 until 2012 is released)
    • Trade & Logistics (AX 2012) 
    • MS Exam 70-290: Managing and Maintaining a Microsoft Windows Server 2003 Environment
    • MS Exam 70-291: Implementing, Managing, and Maintaining a Microsoft Windows Server 2003 Network Infrastructure

--------------UPDATE 02/11/2015---------------------------
Below are the official list of all of the AX 2012 certifications out now.  This is a popular post so I thought I would append to here:
Microsoft Dynamics AX 2012 R2 Project
Microsoft Dynamics AX 2012 R3 Retail
Microsoft Dynamics AX 2012 R3 Financials
Microsoft Dynamics AX 2012 R3 Trade and Logistics
Microsoft Dynamics AX 2012 R3 CU8 Development Introduction
Microsoft Dynamics AX 2012 R3 CU8 Installation and Configuration
Microsoft Dynamics AX 2012 Development Introduction
Microsoft Dynamics AX 2012 Trade and Logistics
Microsoft Dynamics AX 2012 Financials
Microsoft Dynamics AX 2012 Installation and Configuration
Microsoft Dynamics AX 2012 Lean Manufacturing
Microsoft Dynamics AX 2012 Public Sector
Microsoft Dynamics AX 2012 Service Management