Jul 24, 2014

Error: ClearCompanyRange API called for non cross-Company query"XXXXXX"

Some times you may come across to this error when you are working with queries.

Error : ClearCompanyRange API called for non cross-Company query"XXXXXX".

Resolution : set the property AllowCrossCompany of the query to Yes.

Jun 18, 2013

Temporary tables in AX 2012


1.       In a developer's point of view, temporary tables store data in the same way as normal physical tables, except that the data is automatically dropped when no longer required.

2.       Prior to Dynamics AX 2012 versions, only one type of temporary table was available. In AX 2012, however, the Temporary property on tables was replaced with a new property: TableType, which has three possible values:
·         Regular - a standard physical table
·         InMemory - the type of temporary table which existed in the previous versions of Dynamics Ax. Such tables are held in memory and written to a local disk file once they grow beyond a certain point
·         TempDB - a new option in Ax 2012. They are "physical" temporary tables held in the SQL Server database.

3.       The new TempDB tables operate in a similar manner to InMemory tables but support more features from standard physical tables:
·         More powerful joins with physical tables are possible, and are properly supported by the database
·         Can be per-company or global
·         Support for normal tts transactions

4.       You can convert a normal table to a temporary table in code. After doing this, You can now add, modify or delete data from the table without affecting the real contents stored in the database. For example, you can make a regular table as a temporary table as shown below.

InventTable    inventTable;
;
inventTable.setTmp();

5.       Indexes can be created on temporary tables as we doing on Regular tables. When a temporary copy of a normal table is used with .setTmp(), then the existing indexes will also be created on the temporary version.

6.       Indexes will show more impact on temporary table performance. For temporary tables with a lot of records you will experience major performance limitations when searching on non-indexed fields.

Jun 15, 2013

Debugging AIF services of Microsoft Dynamics AX 2012 in Visual Studio

Recently I came across a requirement for that I need to debug the standard AIF services. If we are using the AIF services in .NET application normally we cannot debug the logic inside the services. But there is a way to debug the AIF services. Follow the below listed steps to debug the AIF services.

Fist we need to do or make sure that the following listed settings..

Settings in Microsoft  Dynamics AX Server Configuration Utility:

1.   Go to Start à Administrative Tools à Microsoft Dynamics AX 2012 Server Configuration
2.   On the AOS machine turn debugging on in the server configuration utility by marking following      two checkboxes
a.  "Enable breakpoints to debug X++ code running on this server"
b.  “Enable global breakpoints”. 
3.   Click yes to restart the AOS.

Settings in Microsoft Dynamics AX Client Configuration Utility:

1.  Go to Start àAdministrative Tools à Microsoft Dynamics AX 2012 Configuration
2. On the client machine turn debugging on in the client configuration utility for the Business                   Connector.You can do this in the configuration utility by setting the Configuration Target drop down to Business Connector (non-interactive use only).

    Note: if the configuration in the client machine is original configuration it may not allows you to select the Business connector option, create a new configuration and make it as active so that it would allow you to choose the option 

Set Debugging Mode in AX client:

1. In AX go to Tools > Options > Development tab. Select  “When Breakpoint” in debugging mode option.



Changes in MS Visual Studio:

Do the following settings in .Net application. But these are not mandatory but recommended.

1.      Go to Tools à Options.
2.      Go to Debugging à General. Ensure the “Enable break point filter” option is selected.
3.      Go to symbols in the same window.
4.      Click on new folder icon on top right of the window.

Enter the path where all the Microsoft symbols stored, typically the path would be as shown below.

C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL

Enter the same path in the Cache symbols in the directory. The window would be as shown below.


Click on OK. 

Before debugging the AIF services do the following settings in visual studio:

1.      Open another instance of Visual Studio, Go to Tools àClick on Attach Process.
2.    A window will be open with all installed programs. Select AX32serv.exe as the process to debug and click on Attach.


3.      Open Application explorer and keep the put the break points in the appropriate classes.

      Note : We should not close this instance of Visual Studio where you did the attach process,just        minimize it and keep going on...  

4.      Switch to the visual studio instance where you are using AIf services and trying to debug.
      Start the debugging in Visual studio application then the debugger will automatically switched to AIF classes where you have kept the break point in another instance which you have minimized.

Jun 13, 2013

Failed to create a session; confirm that the user has the proper privileges to log on to Microsoft Dynamics

Failed to create a session; confirm that the user has the proper privileges to log on to Microsoft Dynamics

One of the developer has faced this problem and came to me to resolve this. And i found something in option to resolve this.
Try the following step first it should resolve the issue mostly and it worked for me,
  • Tools > Options > Development > uncheck "Execute business operations in CIL"
If it is not working try the following steps:
  • Restart the AOS
  • Do an incremental CIL compile
  • Do a full CIL compile


Jun 7, 2013

Code Profiler in Dynamics AX 2012

There is a very good feature called code profiler. The Code Profiler measures and records the execution of each line of code, the time taken by each line ,the Parent(caller) and the child of the each lines, all these are saved to database for review, also it has variety of options to review the recorded information
We can use this tool to find and remove the performance bottlenecks to improve the performance of whole application, also its useful to understand the flow of others code quickly

Click Tools > Code profiler to open the Code Profiler tool.


  1. Navigate to the functionality that you want to test
  2. To limit the results displayed, check the Trace depth enabled check box, and then type the number of levels that you want to be displayed in the results.
  3. Click Start.
  4. Use the functionality you want to test.
  5. When testing is complete, click Stop.
  6. The system now saves all logged data to the database. This might take quite some time because a database record is created for each executed line of code.
  7. Write a description of your code profile in the Summary dialog.
  8. Click OK.
  9. The Profiler runs form opens. This enables you to view data collected by the profiler 
You can control the code profiler directly from your X++ code. For this purpose there are two macros:
·         #Profilebegin()
·         #ProfileEnd
These two macros have to be in the same level in a method.

That's it for now...

Jun 3, 2013

Setup could not find Domain 'XXXXX' for Application Object Server(AOS) account

Error "Setup could not find Domain 'XXXXX' for Application Object Server(AOS) account".

Recently i faced this error while installing Dynamics AX 2012. I was trying to use the domain account for AOS. But the setup is not allowing me to proceed further and showing the error "Setup could not find Domain 'XXXXX' for Application Object Server (AOS) account".

This error id due to, the user name is not existing in the users in server manager.

To resolve this issue follow the below steps.

1) Open Server Manager
2) Expand Configuration.
3) Expand local users and groups.
4) Right click on users and click on New User.
5) Enter the valid user name that are exiting under the domain.
6) Enter the full name and click on Ok.

Now  you will be able to proceed further...


May 17, 2013

Combine XPO tool for microsoft dynamics AX

Today i want to show you how to install and use the Combine XPO tool for microsoft dynamics AX.


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.



download the tool from Microsoft Partner source here

This tool you can install in the machines where there in no AX resides also.

double click on downloaded .exe file



Click Next



Read terms and conditions and click on "I accept the licence terms"
click next and click finish. now you have installed the tool. continue to know how to use the tool.

After installation you will see a folder with the name "Microsoft Dynamics AX 2012 Combine XPO Tool Beta 1.0". if you open this folder you will get a pdf manual also to know how to use this tool.

How to work with this tool:

crate 2 folders in any location. now i am going to crate two folders with the names CombineXpos ans CombineXposResult in my D drive.

Place any number of xpos into CombineXpos folder. and to combine these Xpos we have to write a command line in command prompt

CombineXPOs.exe -XpoDir D:\CombineXpos -CombinedXpoFile D:\CombineXpoResult\AXModelAFiles.xpo



now you have a look into the folder CombineXpoResult folder, you will get a xpo that contains the all xpos together those you placed in CombineXpos folder and its sub folders also.

hope you like it....