We can expose AOT query as service which can consume in any WCF client. We can call and fetch data from any AX table,  without Static AOT query. For this purpose Dynamics Ax provide the methods to create a query at run time and call with Query service.


This Query service is built in feature if during Application Interface framework component installed with Dynamics Ax Setup.



using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data;

//using Microsoft.Dynamics.AX.Framework.Services.Metadata.Contracts;




namespace ConsoleApplication1


class Program


static void Main(string[] args)


testService.QueryServiceClient _QueryClient = new testService.QueryServiceClient();

DataSet dataSet;

testService.Paging paging = null;

testService.QueryMetadata query;

testService.QueryDataSourceMetadata customerDataSource;


query = new testService.QueryMetadata();


// Set the properties of the query.

query.QueryType = testService.QueryType.Join;

query.AllowCrossCompany = true;

query.DataSources = new testService.QueryDataSourceMetadata[1];


// Set the properties of the Customers data source.

customerDataSource = new testService.QueryDataSourceMetadata();

customerDataSource.Name = "DataArea";

customerDataSource.Enabled = true;

customerDataSource.FetchMode = testService.FetchMode.OneToOne;

customerDataSource.Table = "DataArea";

// Setting DynamicFieldList property to true returns all fields.

customerDataSource.DynamicFieldList = true;

//Add the data source to the query.

query.DataSources[0] = customerDataSource;


dataSet = _QueryClient.ExecuteQuery(query, ref paging);

foreach (DataRow dr in dataSet.Tables[0].Rows)













if you got error with similar message “The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

update the binding section of app.config

<binding name=”QueryServiceEndpoint” transferMode=”Streamed”
<readerQuotas maxDepth=”32″



In Dynamics Ax 2012, Fiscal year is common all the legal entities. They usually define in initial step of implementation. The length of Fiscal years is up to user how long he defines the length according to requirement.

They are essential for financial reporting for particular company. Define the account period or begin and end date for one financial cycle.


In Pakistan, Fiscal year usually starts from 1 July and ends at 30 June.


You can define the fiscal year from following link

General Ledger-> Setup-> Fiscal Years

4-9-2015 7-25-02 AM

4-9-2015 7-25-31 AM


As I working on contoso demo data for my R & D.  By clicking on above link all Fiscal years appears as follow



We can add Fiscal year as follow by clicking on new fiscal year in Dynamics Ax 2012

4-9-2015 7-55-13 AM





Now I am going to create a fiscal year with what follow in Pakistan. In Pakistan companies follow the Fiscal year starting from 1 July and ends at 30 June every year.

Lahore-Foscal year



As I select the length of period is 1 month the default calendar build with respect to as follow.

4-9-2015 8-13-40 AM



Ledger Calendar : Are based on fiscal year calendar. Every ledger transaction is mapped in open period of fiscal year selected as ledger calendar. You can find ledger calendar form following link


General Ledger-> Setup-> Ledger




From Fiscal calendar dropdown, you can change the fiscal year calendar in Dynamics Ax 2012.

Ledger det

And from above menu button, we can see the detail of selected fiscal year calendar





I changed the fiscal year in ledger I got following message


4-9-2015 8-31-48 AM

“The fiscal calendar has been updated. We recommend that you run the recalculate ledger period process.”


To Recalculate ledger period click on top menu.




Following dialog box which run the batch process, You can set it re occurrence. Click ok to recalculate the ledger period process.






Recently I have to generate a ER-diagram for specific list of tables in Dynamics Ax.  Dynamics Ax has built in feature.

Prerequisite of this article has Microsoft Visio.


Create a project for all tables which require in ER-diagram.

For this article I  created a new project with Name customer Address and drop CustTable and DirpartyTable in it.


In AOT or development workspace. Click on tools and reverse engineer menu .


4-1-2015 12-11-00 AM


Following form will open, Select location where file with ERX will be generated. Select your private or public projects.

4-1-2015 12-12-013

Click ok to generate it.


When file is generated, go on windows start up menu and open MS visio. Select database modeling Diagram Template.

4-1-2015 12-14-013


When Database Model diagram is open, From database menu=> Import=> Import Erwin ERX file…

load erx file generated in previous step. This menu is only available when you select Database diagram as template in Visio.

4-1-2015 12-15-44 AM

click on Browse.. button and load erx file.4-1-2015 12-17-52 AM



Click ok

A small dialog shows the import status

4-1-2015 12-18-19 AM

Next step you have to enable view for Tables, So you can select tables for ER-Diagram

Database=>View=> Tables and views

4-1-2015 12-18-57 AM

You will found following pane at left side of screen.

4-1-2015 12-19-20 AM

Click on required table to add it on page and it will show required tables with relationship.

4-1-2015 12-22-046



You can re-size these diagrams.


I was configuring Dynamics AX 2012 R3 reporting extension on one of Virtual machine. Here is my notes with step by step screen shot.

First step to run step up and then add or modify component option.

Add remove

Click on next button and select reporting extension  form

3-17-2015 11-19-54 AM

Click on next and from next window click on

3-17-2015 11-23-12 AM

3-17-2015 11-20-21 AM

Validate it, if any component is missing then download and install it.

When validate and click on next.

3-17-2015 11-21-22 AM


From next screen enter Business connector, as on my R&D virtual machine


From next screen select the required reporting server.

3-17-2015 11-21-06 AM

If you want to deploy report just after the installation, check the deploy reports.

Click next to run the installation process,

3-17-2015 11-24-14 AM

3-17-2015 11-26-34 AM



Now a power shell window opens report deployment is started.

3-17-2015 11-27-03 AM


Let it completed.


After let it complete, Open Dynamics Ax client by right click on its icon and run as administer.


Now go at Administrator module and click

3-17-2015 1-31-32 PM

And ad server name and click on validate button

3-17-2015 1-31-58 PM

Now report server configured successfully and all reports will successfully run.


Microsoft Dynamics Connector and installation and configuration step by Step.


I configured the Microsoft Dynamics Connector on my local configured virtual machine where standard Microsoft Dynamics Ax 2012 R3 installed.

Here are step by step and my notes


First step to run the setup form and choose add or modify component option

Add remove


Click on next and select the connector from very below end

Select the option

Next to validate, if validation failed then download required component to made it validate.



Click next button


From next step select the default server on which you are installed the connector.

Service Account

Enter the service account and click on next.

Domain user

Here is trick, Setup required a user, I created a separate user in my domain control with administrator rights. Like “dynamicworlds\AXIntUsr”.  Select the “create new account”.

If you want to use existing ax user then select “Use existing account” and enter its name against Ax user ID.

I used the create a new user ax option, It will added the domain user into Ax with following groups



Click next and complete the step. And check the log file if there is failure else complete it.


Now run the Dynamicsrun connector with administrator rights


And select Dynamics Ax adapter.

Set its configuration with newly created user



Click on configure Microsoft Dynamics Ax 2012 link to open second screen


Click on refresh services.


And select the required service. And click on configure button


Now close this window and click on click on test button. This will also result on success.



In ERP implementations different individuals perform different roles and work as team. These roles varies organization to organizations. I observer ERP consultants in following roles.


Functional consultant:

These are unique individual, who usually expert in particular module of Dynamics Ax. They have day to day interaction with business user at client side. They responsible for understanding the functionality of client, document these business process and map them into Dynamics Ax out of the box functionality. They also interact with technical consultant for testing the customization and checking the functionality is fully working after customization. They are more focused on certain module of dynamics Ax like GL and financials. Production, Inventory management or procurement and sourcing.


Senior functional consultant:

These are experienced resource, they have grip on more than one module of dynamics Ax. These guys are usually involves in finalizing the requirements. They also responsibly discussion with joiner consultant and solve their queries against certain problems. These guys are second level decision making for customization if certain business process does not meet with out of box functionality. These individuals are domain specific as per particular modules for example public sector or supply chain management.

Basically they are responsibly of leading other functional consultant and taking care of organization level implementation of Dynamics Ax 2012. Sometimes client sign off also in their part of responsibilities.




Technical consultant:

These are extra ordinary individuals (Because I am part of this group), who are responsible for Customization, alteration and integration of Dynamics Ax 2012. Basically they have strong technical guys who have software development background.  Microsoft dynamics Ax offers extensive customization, integrations, So Usually .net developers are easily convertible to these technical consultant.


As per my observation Microsoft Dynamics AX Technical consultant can be divided into three to four Major roles

Enterprise portal customization. These guys have Share point expertise as well as understanding of Dynamics AX. They develop customization which are used in enterprise portal of Dynamics Ax 2012.

BI and Report development and Customization.

These technical consultant have experienced in Business intelligence ie. Data extraction, Cubes and report development. They are responsible of customization and new development of Reports both data mart comes with dynamics Ax, out of Dynamics Ax for example retail BI and normal SSRS reports for Dynamics AX.


Integration Consultant:

These guys have experience with Integration and data migration. They integrate Dynamics Ax with any other system.  They are responsible of understanding of dynamics Ax and other system and then write solutions. They are experts in Application Integration framework of dynamics ax. They have responsibly for writing field mapping, transformation and technical detail documentation for integration. They are also responsible for writing EAI application using BizTalk server, SSIS packages to integrate or migrate data from AX and other systems.


Customization Consultant:

These guys are expert in Dynamics Ax form development, workflow customization with respect to Requirement or functional design document brings form functional development.



Infrastructure consultant:

These guys understand the client organization requirement for example number of users, processing requirement and then suggest the infrastructure for Microsoft Dynamics Ax for best performance. For example how many server require, how the server handle the client session as well as what will be back plan when one or more server down. These guys have Network as well as database administrator background. These guys make solid foundation on which whole building of ERP implemenation stands. These guys appears in initial phase of ERP implementation. In later part they deploy the latest patches on dev, QA and production. And ensure the code migration from QA environment to Production environment. When ERP is in production, they also took timely back up Database of ERP.




Senior technical consultant:

These are guys responsible for development customization of Dynamics AX or all above mention roles. They are architect of customization for Dynamics Ax and new custom module development. They usually communicate with functional consultant. Understand their requirements and communicate it to other developers.



Techno functional consultant:

These mythical guys are those who had deep knowledge of out of the box functionality of ERP and Technical side of ERP. There is myth that when you worked three or more years in technical side of ERP you are starting grow on functional side.  Mythical attributes of techno functional are used to suppress both technical and functional guys by Management. According to management techno functional consultant have plug and play functionality. When there is need to functional consultant, they act as functional consultant. And when there is need of technical consultant they act as technical consultant. Something like these guys are shape shifter. Truly speaking these are sharp guys who can tackle the other guys.




Task recorder tool Dynamics Ax 2012 R3

by alirazazaidi on March 10, 2015


Process Indicator in Dynamics Ax 2012

by alirazazaidi on March 3, 2015

During one of my customization, I have perform a lengthy operation, during this process there is requirement to show process indicator, Code snippets I have found from



For this method I have to create a process helper class and add following snippet its static method


static void operationProgress_progressBars(Args _args)



SysOperationProgress progress = new SysOperationProgress();

int i;




progress.setCaption(“File Transfer with Payment entries are in progess…”);



for (i = 1; i <= 50000; i++)


progress.setText(strfmt(“The value of i is %1″, i));

progress.setCount(i, 1);





For testing purpose I add a new form and on its button click, I added from following line code.








void clicked()


Args arg = new Args();











This progress operation must be run between two build in functions, that helps to cover the lengthy process in Dynamics Ax 2012.

3-3-2015 1-22-46 PM


split string in dynamics ax 2012

by alirazazaidi on February 28, 2015

During one of customization scenario, I have come across to field which contains comma separated values. In C# and VB.net string.split method return into array of string. But in X++  split method return list. Following simple tip helps me to check that my required value exists in comma separated value.

public boolean getValidateStudentName(String50 _splitString)



List strlist=new List(Types::String);

ListIterator    iterator;

str _Value;

boolean _NotFound=boolean::true;



iterator = new ListIterator(strlist);



_Value =iterator.value();

if (_Value ==”Ali”)




if (_Value ==”Raza”)




if (_Value ==”Zaidi”)




if (_Value ==”Lahore”)




if (_Value ==”Pakistan”)






return _NotFound;



Material from Microsoft Dynamics Technical Conference 2015 is available for download.

This material contains,

  • Training manuals.
  • PDF,
  • Videos
  • Power point presentations
  • Hand on lab material.



For visiting this linking you must have partner source or customer source credentials.