[ ax2012 ] SO charge code

– charge code is for the whole invoice

– register charge code in SO, then invoice, after that the charge code is post to that invoice and charge code in SO is disappeared.

– when we issue another invoice, we have to enter the charge code again.

– to keep the charge code, tick `Keep` in Charges form


[ ax2012 ] calling Ax32.exe instead of AxHLink.exe

Since AxHLink.exe will limit to only the default configuration, we will call the Ax32.exe that is more open to various configuration instead.

To do that,

instead of calling

AxHLink.exe Dynamics://0?DrillDown_5637192587

we use startupCmd parameter of Ax32.exe

"C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32" "C:\path\to\configuration.axc" -startUpCmd=DrillDown_5637192587

Note that we can find multiple feature of startUpCmd under `Switch` section of the following class ( as explained in MS ref )


Note2 : allow all arguments to pass from the client is risky, so it is better to call to .bat or .lnk instead of calling directly to ax32.exe

ref : http://stackoverflow.com/questions/23336165/open-direct-links-to-ax-objects-or-datasets-from-external-application

[ ax2012 ] called by Csharp

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
public MainWindow()

private void button1_Click(object sender, RoutedEventArgs e)
// System.Diagnostics.Process process = new System.Diagnostics.Process();
// System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
// startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
// startInfo.FileName = "cmd.exe";
// startInfo.Arguments = "C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/Ax32.exe";
// process.StartInfo = startInfo;
// process.Start();

string str = @"C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe";
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = str;
process.StartInfo.Arguments = @"-startupcmd=AutoRun_C:\csharp_prototype\XMLFile1.xml";


private void button2_Click(object sender, RoutedEventArgs e)
string str = @"C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe";
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = str;
process.StartInfo.Arguments = @"-startupcmd=AutoRun_C:\csharp_prototype\XMLFile2.xml";
<?xml version="1.0" encoding="UTF-8"?>

<AxaptaAutoRun logFile="$HOME\axEXProd.log" version="4.0" exitWhenDone="false">

<Run name="SalesTableListPage" type="displayMenuItem"/>


more info : http://msdn.microsoft.com/en-us/library/sysautorun.aspx

[ ax2012 ] dynamics protocol

Access to protocol dynamics://


(Default)       =”URL:dynamics link”

URL Protocol=””


(Default)         =”path\to\AxHLink.exe %1″


ref : http://stackoverflow.com/questions/3468000/problem-setting-up-custom-url-protocol-on-windows-ce

NOTE: to open RemoteApp ( .rdp ), use mstsc command, for example

(Default) = mstsc.exe "D:\AXHLink.rdp"

or if we would like to pass parameter, just use the simple batch file and point the link to batch file


(Default) = D:\AXHLink %1

batch file that append `remoteapplicationcmdline:s:`

@echo off
copy D:\\AxHLink_Template.rdp D:\\AxHLink.rdp
echo %* >> D:\\AxHLink.rdp
call D:\\AxHLink.rdp

[ ax2012 ] Some Form of Some User crash


– User can open AX Client

– but cannot access some form

– while another user can access the same form

Root cause

This is because of the Personalized setting. ( User may add some fields etc. to make the form crash )


– File > Tools > Options

– Usage Data

– Form setup

– remove all the rows that related with this form

[ ax2012 ] print to send mail

Goal : print PO by send mail

0. set e-mail parameters like in this

System administration > Setup > System > E-mail parameters

1. Set at vendor

General > Print mangement


2. right-click > override

enter email address


3. when print PO, tick use print management




If you are running CU7, you can send to specific vendor email contact using suggestion in msdn.

NOTE : if not using print management ( use Printer setup > Purchase Order ) it will pop outlook program to send mail, not sending from the mail server.


[ Ax 2012 ] Product Attribute


1. Define attribute type

Product > Setup > Attribute > Attribute Type


2. Define attribute

Product > Setup > Attribute > Attribute


3. Add to Hierarchy

NOTE : in my case I use procurement category hierarchy, so I set up at `Procurement and Sourcing > Setup > Categories > Procurement Categories`

procurement_category4. Enter the value for the Attribute. choose the right product categories of the product, then Go to `Product Attributes`

product_categoryEnter the value


ref : microsoft