Adding service account to the debug group

To add the AOS service account to the debug group

  1. From the Start menu, point to All Programs, click Administrative Tools, click Computer Management, and then click Local Users and Groups.
  2. In Local Users and Groups, double-click Groups, right-click Microsoft Dynamics AX Debugging Users and click Add to Group.
  3. In the Properties window, click Add and add the AOS service account to the group.
  4. Restart the machine.

Join Types and Link Type in ax 2012

Join Types:-

1. InnerJoin: – Combined data source – select the record from the main table that matches records in the joined table and vice versa.
There is one record for each match. Records without related records in the other data source are eliminated from the result.

2. Outer Join: – Combined data source – select the records from the main table. The records are retrieved whether they have matching records in the joined table.

Returns the left outer join of the first and second tables.

3. Exists Join: – Combined data source -The data source retrieves a record from the main table for each matching record in the joined table.
The differences between InnerJoin and ExistJoin are as follows:
· When the join type is ExistJoin, the search ends after the first match has been found.
· When the join type is InnerJoin, all matching records are searched for.

Returns true if any records are in the result set after executing the join clause. Returns false otherwise.

4. NotExists Join: – Combined data source -Select records from the main table that do not have a match in the joined table.

Returns false if any records are in the result set after executing the join clause. Returns true otherwise.


Link Type:-

1. Active: – Parent and child- data source is updated immediately when a new record in the parent data source is selected. Continuous updates consume lots of resources consuming.

2. Delayed: – Parent and child – A pause is inserted before linked child data sources are updated. This enables faster navigation in the parent data source because the records from child data sources are not updated immediately. For example, you can scroll a list of orders where you do not want to review the lines associated with the order until you stop scrolling.

3. Passive: – Parent and child – Linked child data sources are not updated automatically. Updates of the child data source must be programmed on the active method of the master data source.

Relations in AX

1)Normal         2)Fieldfixed       3)Related fieldfixed

Normal:::To specify the relation fields without any conditions…

Fieldfixed:::To specify the relation fields to restrict the records in the” primary table”..[Means first table]

Related Fieldfixed:::To specify the relation fields to restrict the records in the “related table”….[Means Related table]

For Example:

Take two tables…Custtable having Accno,Name,Gender[male,female—- male means0 female means 1]    [primary table]

CustTranse having Accno,Transdate,Amount,Paid  [ yes or no—–yes means 0   no means1]   this is related table [Secondary table]


Fieldfixed—-   Custtable.Gender    == 0

Related Fieldfixed—-   1 == CustTranse .paid

Choose File in ax Dialog

Below is the job to choose the selected file through the Dialog box.

static void DialogFilePath(Args _args)
    Dialog          dialog;
    Filename        filename;
    DialogField     dialogFilename;
    //To filter the files while selecting
    container      conFilter = ["Microsoft Excel 97-2003 Worksheet (.xls)" ,"*.xlsx"];
    //container    conFilter = ["Comma Seperated Value .txt ", "*.csv"];

    dialog = new dialog();
    dialog.caption("select a file");
    dialogFilename = dialog.addField(extendedTypeStr(FilenameOpen));
    //To filter the files while selecting    

            filename = dialogFileName.value();

Simple Dialog

Do you ever feel how to make a dialog field as Mandatory, if so then follow as below
Make the Dialog Field mandatory as true as shown below:

 Dialog dialog;
 DialogField dialogField;
 dialog = new Dialog("Dialog Test");
 dialog.addText("Select customer:");
 dialogField = dialog.addField(extendedTypeStr(CustAccount));
 dialogField.label("Re-Name");// TO Re-Name the Field Name in Dialog
 dialogField.mandatory_RU(true);// To make Dialog as mandatory
 dialogField = dialog.addField(enumStr(Gender));//To get Enum in dialog box;
 if (dialog.closedOk())

Setting Status Bar options in Code and SQL

As a developer or functional consultant we quite often receive support requests from users with very little information as to their circumstances under which the issue occurs. E.G. What environment where they working on (Prod, QA, Dev)? What is their userId etc (in order to find out security settings applied)? What currency? and most importantly what AX company they are logged into. All of this information can be set to be displayed in the users status bar by setting enabling it per user under Administration -> Users -> Options -> Status Bar.

It really helps to have it set over there so that screenshots will normally just show this information.

However you may want to set these options globally for all users when initially configuring the system. Doing this manually is quite a tedious process and there is no field per setting to do it in a quick sql script or AX job. Rather AX stores it in a single binary field called “Userinfo.StatusLineInfo” and uses bitwise operators for setting and reading the individual options. This really makes it a bit tricky to set but is very efficient in terms of space and reading speed for the system.

So how do you perform this global setting? My first two options will show you how to set all users to have the same option sets, my last solution will show you how to set only one specific setting for all users.

OPTION 1 (AX Solution): 
1. Login with your AX user and navigate to Administration -> Users -> Options -> Status Bar.
2. Set all the status bar parameters that you would like to display for all users.
3. Create a new Job in the AOT with the following code:

static void syncAllUserToCurrentUserStatusBarOptions(Args _args)
    UserInfo user, updUser;
    select user where == curUserId();
    update_recordSet updUser setting StatusLineInfo = user.StatusLineInfo;

OPTION 2 (SQL Solution):
1. Login with your AX user and navigate to Administration -> Users -> Options -> Status Bar.
2. Set all the status bar parameters that you would like to display for all users.
3. Login to your SQL database for AX, locate your user record in the UserInfo table
4. Copy the StatusLineInfo value field value.
5. Execute the following script

update userinfo set statuslineinfo=[COPIED VALUE]


update userinfo set statuslineinfo=-529533

This example will set all users to have the following options: Show help text, Show Utility layer, Show Company accounts, Show currency, Show UserId, Show Alert Status, Show AOS name, Show Current Model, Show Document Attachments button, Show Record Navigation buttons, Show View Edit Record Button, Show details form details/grid view buttons.

Option 3 Set a specific option for all users:
1. Open the AOT, expand forms node, navigate to SysUserSetup Form.
2. Right click, click “View Code”
3. Open the “ClassDeclaration” method.
4. Move down to approx line 57 where there are a whole bunch of macros entitled #LOCALMACRO.FLAG_XXXXXXXX
5. Locate the macro that has the setting that you want to use e.g. #LOCALMACRO.FLAG_StatuslineShowPartition to show the default partition. Take note of the value after the “<<” symbol. E.g. 19

6. Create a new job with the following code:

static void addStatusBarOptionToAllUsers(Args _args)
    UserInfo updUser;
while select forUpdate updUser
updUser.statuslineInfo = updUser.statuslineInfo | (1 << [value from step 6]);

E.G. To set all users to show default partitions:

static void addStatusBarOptionToAllUsers(Args _args)
    UserInfo updUser;
while select forUpdate updUser
updUser.statuslineInfo = updUser.statuslineInfo | (1 << 19);

7. Execute the job

NOTE: To remove a setting from all users simply replace the line

updUser.statuslineInfo = updUser.statuslineInfo | (1 << 19);


updUser.statuslineInfo = updUser.statuslineInfo ^ (1 << 19);

OLTP vs OLAP – Definition and Differences

We can divide IT systems into transactional (OLTP) and analytical (OLAP). In general we can assume that OLTP systems provide source data to data warehouses, whereas OLAP systems help to analyze it.

In Microsoft Dynamics AX 2012 database we can find an OLTP database, which stores the AX data and the AX Model store, and the SSAS database used for SSRS reporting. At the same time, the Microsoft SQL Server Analysis Services uses an on-line analytical processing (OLAP) engine that helps users analyze business data and identify trends.

In this post I would like to describe what OLTP and OLAP is, differences, and provide a day-to-day example about the two.

OLTP (On-line Transaction Processing) deals with operational data, which is data involved in the operation of a particular system and it is characterized by a large number of short on-line transactions (INSERT, UPDATE, and DELETE).

The main emphasis for OLTP systems is put on very fast query processing, maintaining data integrity in multi-access environments and an effectiveness measured by number of transactions per second.

In addition, in an OLTP system, the data is frequently updated and queried and to prevent data redundancy and to prevent update anomalies the database tables are normalized, which makes the write operation in the database tables more efficient.

Example: In a banking System, you withdraw amount through an ATM. Then account Number, ATM PIN Number, Amount you are withdrawing and Balance amount in account are operational data elements.

An OLAP (On-line Analytical Processing) deal with Historical Data or Archival Data, and it is characterized by relatively low volume of transactions.  In addition, the Queries needed for these systems are often very complex and involve aggregations as for OLAP systems the response time is an effectiveness measure.

Example: If we collect last 10 years data about flight reservation, the data can give us much meaningful information such as the trends in reservation. This may give useful information like peak time of travel, and what kinds of people are traveling in the various classes available (Economy/Business).

The following table summarizes the major differences between OLTP and OLAP system design.

OLTP System
OLAP System
Source of data
Operational data; OLTPs are the original source of the data.
Consolidation data; OLAP data comes from the various OLTP Databases
Purpose of data
To control and run fundamental business tasks
To help with planning, problem solving, and decision support
What the data
Reveals a snapshot of ongoing business processes
Multi-dimensional views of various kinds of business activities
Inserts and Updates
Short and fast inserts and updates initiated by end users
Periodic long-running batch jobs refresh the data
Relatively standardized and simple queries Returning relatively few records
Often complex queries involving aggregations
Processing Speed
Typically very fast
Depends on the amount of data involved; batch data refreshes and complex queries may take many hours; query speed can be improved by creating indexes
Space Requirements
Can be relatively small if historical data is archived
Larger due to the existence of aggregation structures and history data; requires more indexes than OLTP
Database Design
Highly normalized with many tables
Typically de-normalized with fewer tables; use of star and/or snowflake schemas
Backup and Recovery
Backup religiously; operational data is critical to run the business, data loss is likely to entail significant monetary loss and legal liability
Instead of regular backups, some environments may consider simply reloading the OLTP data as a recovery method