Thursday, March 23, 2017

Independent transaction in AX

Sometimes we need to write some data into a database independently on the currently running DB transaction. For example, we want to log some state occurred in the application, however any exception could cause a rollback of the whole transaction, including the log entry. It could look as follows:
LogTable logTable;
;
ttsbegin;
logTable.Message = "Something happens";
logTable.insert();
//some following code in the same transaction throws an exception
throw Exception::Error;
ttscommit;

It can be resolved quite easily. We need to create a separate database connection and possibly our own transaction. The modification of the preceding code would look as follows:

LogTable logTable;
UserConnection connection = new UserConnection();
;
ttsbegin;
//use another connection
logTable.setConnection(connection);
//beginning of the independent transaction
logTable.ttsbegin();
logTable.Message = "Something happens";
logTable.insert();
logTable.ttscommit();
//this exception doesn't affect the logTable entry
throw Exception::Error;
ttscommit;

Thursday, March 9, 2017

Microsoft Dynamics AX Retail

In this post we will highlight components of Dynamics AX Retail. Dynamics AX Retail architecture are divided into two main categories named as Headquarters and Store as shown below.




Let's discuss these categories and their components in details.

Headquarters


Besides having AX essentials components such as Client, AOS, Enterprise Portal and AX Database we have Real-time service and Async Server with message database. The Retail Headquarters component installs runtime components that are required to enable key aspects of Retail functionality, such as the screen layout designer. This component must be installed on the Application Object Server (AOS) computer and on Microsoft Dynamics AX client computers.

Wednesday, March 8, 2017

Combine XPO Tool

The Microsoft Dynamics AX 2012 Combine XPO Tool is a command line program that combines a set of interdependent XPO files into a single XPO. For example, if a team of developers is making code changes to different aspects of an application, they can use this tool to merge those changed files into one XPO file.
As of AX 2012 R2, the Combine XPO Tool is available in the Microsoft Dynamics AX\60\Management Utilities folder. (The beta version of the tool was previously available on InformationSource).

Demonstration

For demonstration purposes I have created two XPO's XPO1 and XPO2 respectively and the output will be a merged XPO containing objects in XPO's file.

XPO 1
XPO 2

The Combine XPO tool generates an XPO file that is a combination of the XPO files in a given folder and any subfolders. It takes the path to the folder and the name of the resulting XPO file as input. For example, if you have XPO files in the C:\MyApplication\ModelA folder, you would use the following commands to create the combined XPO file:
CombineXPOs.exe -XpoDir c:\MyApplication\ModelA -CombinedXpoFile c:\MyApplication\AXModelAFiles.xpo

Results

Merged XPO