A few days ago I got chance to work on list page which contains the lines which are assign to current user or login user for approval.

In Dynamics Ax 2012, every workflow is based on some table. Here we create Query and enable workflow on it.

When any record is submit for approval. So how the other Dynamics Ax 2012 workflow create entries in out of the box workflow tables.  If we open AOT there a lot of table which is used by Workflow engine.



For current requirement we have to create custom query which is based on document table and out of the box workflow table. But problem is there too much table and how to understand relation ship between tables.


In Dynamics Ax, when no solution available then best solution is reverse engineering. Explore what Microsoft already did, try to understand it and then create your own solution.


After exploring I found that in procurement module there is “Purchase requisition assign to me” list page where the similar task is done by Microsoft itself.


This list page is based on AOT /Static Query “PurchReqTableAssignedToMe”.

Requisiation AssignToMe

On expanding I found relationship between following tables.


-Document table current example it is PurchReqTable

-SysworkFlowTable (as parent or Header table).

-SysWorkFlowTable ( as child or line table).


purch Assign to me


You can explore this query in more detail and replicate this with respect to required table on your workflow based and use this query in list page.

In this form you have to set design properties to enable it for workflow. For example current PurchRequistionAssignToMe list page has following properties.



Hope this helps



Today we face an error on our client environment that when we run the report Customer Account Statement shows error in info box as.

Stack trace: Field ‘abcd’ in table ‘CompanyInfo’ has not been explicitly selected.

Stack trace

(C)\Classes\CustAccountStatementExtController\setCommonData – line 29

(C)\Classes\CustAccountStatementExtController\runPrintMgmt – line 76

(C)\Classes\SrsPrintMgmtController\run – line 14

(C)\Classes\SysOperationController\startOperation – line 10

(C)\Classes\SrsReportRunController\startOperation – line 12

(C)\Classes\SrsPrintMgmtController\startOperation – line 14

(C)\Classes\SrsPrintMgmtFormLetterController\startOperation – line 14

(C)\Classes\CustAccountStatementExtController\main – line 6



After searching I found reply on Dynamics Ax forum by André Arnaud de Calavon where he gave the link Dick Wenning post, Hat off for them.



Problem was in company info table value of “abcd” is null, and by unknown reason Ax did not recognize null value and show as Un retrieve. Due to this error report did not works. I found there are many other fields’ in a row are un-retrieve.


Solution open Sql server and run update query on Dynamics Ax 2012 Database ie. MSDynamicsAX or it depends on installation of Dynamics Ax 2012,


Update table CompanyInfo set “abcd”=”” where Name =”us01”.


Cheers, report run successfully.



Sale Order processing In Dynamics Ax 2012 R3 part 1

by alirazazaidi on September 12, 2015

In dynamics Ax 2012, we can sale stock Item and service Item through sales orders.

We can create sales order from Sales and Marketing module or Account receivables module.

Currently I am creating and exploring Sales order on demo data contoso data and legal entity UsMF.

Open Sales and distribution module and from common menu expand sales order and click on “All Sales order” menu.


Click on it and open sales order

All Sales Order

Now click on top Sales button

Sales Order

A new popup or dialog open


Select customer for against you want to enter sale Order. For example I create Sales order for Cave wholesales customer.



Now expand General fast tab. Customer Invoice Account is already selected, we can also change Currency, currently I select USD.



If we explore Order type. We find five type of sales order


We explore more, we found

Journal:  If we select sales order of type Journal. There is no financial and Inventory impact of sales order. It will be draft sale order.

Subscription:  We can create periodic re-occurring sales orders.

Sales Order:  Sales order type will be have impact on financial and Inventory. It means, items or services are deliver to customer.

Return Order: We can register sales return, Item quantity will received back from customer and customer credit note will be generate against the sale order.

Item requirement:  This type of sales order related to project requirements.

Please select Sales Order and click on ok.


From Administrator fast tab, you can also select sales order origin for example we are register sales order from phone call, mail, fax or email. Similarly I also select Sales responsible.


Click ok to Create Sales Order

It will open Sales order detail page. By default it will open Item view


Now we select Item for sales and Item configuration.



Other Item other dimension can be set like warehouse and site.




For current sales line I enter 2 percent discount amount.

Similarly we can create multiple items.

Multiple Sales Item



Sales from action pane click on Sell tab and click on confirm button

Sales Order confirmation

Posting a Sale Order confirmation will nothing more record keeping the document. It is just create a receipt for insure customer that your sale order is booked or confirm,

Sales Order confimration Dialog

You can generate print and click OK to confirm it


I confirmed the sales order multiple times, you can see the confirmation history from sell action  tab strip





Further sale order processing will be in next post





Today I face an error while confirm sales order

“Can not create a record in Audit trail (transactionLog).


While searching I found solution already posted by “PavanKumar Idupulapati” at http://pavanidupulapati.blogspot.com/

That’s work for me, with link reference I update the transactionlog table’s create method with following statement

if (appl.lastTransactionIdCreated() != appl.curTransactionId())


if (!TransactionLog::find(appl.curTransactionId()))


transactionLog.Type = _type;

transactionLog.Txt = _txt;










References I used




Sales Quotations In Dynamics Ax 2012 R3.

by alirazazaidi on September 11, 2015

Sales process usually starts with Request for Quotation. And result Sales Quotation generates and send to client. These clients were possible two types. Either they were register customer with organization or they were first time come to register. These first time client which possible become customer or reject our quotation handle as Prospect in Dynamics Ax 2012.

These prospects may be person, organization or individuals. They register In Dynamics Ax 2012 is very similarly as customer register. Only difference between customer and prospect is that prospect has no financial impact. They are just record keeping or register sales of Quotation. But in the case of client accepts the sales quotation, the prospect must be converted into customer and sale quotation into sales order.

Now we go to create a new prospect and then send sales quotation, and accept the sales quotation to convert Sales Order.

At the time of writing this article I am using Dynamics Ax 2012 R3 Cu9 with demo license.

Open Ax client and go in Sales and marketing module.

Sales and Marketing=> Common=> Prospects => All prospects





List page of all prospects open, click on prospect and open a create a new prospect form.



For current article I want to create prospect for person type. I select Person from drop down. Entry required highlighted and click on save and open to prospect detail page,

From detail form you can change Type Id to customer / vendor or let it prospect, I left it as prospect as default value selected. You can also update sales tax group for prospect.






Now click on top menu click on sell and then click on Sales Quotation



A new Sales Quotation form will open

Form is very similar to sales order, but having very limited option as compare to sales order.


For current example we select two items and described 100 items per 100 dollar as unit price.



Save it now open to quotation tab. And click on send Quotation






If you want print on click on “Print quotation” chick box and click on ok


Info box appears to show infobox.



Now we got feedback from client, for this open sales quotation and from follow tab strip You will find confirm, cancel and lost quotation button.





As we member we did not change the type of Prospect to customer so AX will not let you confirm sales quotation. In the case of rejection or cancel you can click on cancel or lost button to reject the sales quotation.

For current example, we assume that our sales quoatation is accepted and new we convert this sale quotation into sales order. First step to convert prospect into customer, for this click on convert to customer , you will find small popup form. Where you can enter customer account.



After entering new customer account, you can check that account number is valid, click on check button, for example I added the small length customer account and following error message shows



Now enter account with required length check and then press ok.


You can see that after converting prospective into customer, Confirmation button is enabled






Click on confirm to convert this into sales order


Click ok, Sales Quotation converts into sales order


If we open sales order list page we find a new sales order created against sales quotation.



Exploring data cache in Dynamics Ax 2012

by alirazazaidi on September 7, 2015

In Dynamics Ax 2012, table level cache has been performance improving feature.

In Dynamics Ax 2012 we can set both client and server side (AOS) level caches.

When cache at client and server side enabled. Then user query, first search will be done on client side cache, result not found then Ax tries to locate record at server side. In the case of record not found at server side, they will be fetch from table.

Client side cache is exclusive for every  client, while Server side cache can be access by any client.


We can set number of records from System administrator module

server Menu

At performance optimization tab we can set both client side and server side AOS.



In Dynamics Ax 2012, we can set two types of Cache, Single record or set based Cache.

We can set cache type in cacheLookup property of table.

For example we can set cache lookup for custtable as follow




In the case of single record based cache, we can set following properties in cache lookup

  • NotInTTS,
  • Found
  • FoundAndEmpty


For Set-based cache, we have to set the cache lookup to Entire table.

According to Microsoft Documentation

When the CacheLookup table property is set to EntireTable, all the records in the table are put in the cache only if the WHERE clause in the SELECT statement includes equality tests on all fields of the unique index that is defined in the PrimaryIndex table property.

Following consideration required for Set-based or entire table cache.

  • Cluster index must be set on table so it will quickly load
  • Cache size must be under 218, otherwise cache is moved to disk which is much slower to access.
  • Should be used on lookup tables because data is less there.




My session on Lahore Microsoft Invocation Center was at 24-8-2015. Purpose of this session was give introduction about Dynamics Ax to young graduates. Target Audience was of 0-1 year working experience.

This slideshow requires JavaScript.


Exploring the Full text index In Dynamics Ax 2012 R3

by alirazazaidi on August 23, 2015

Consider following points for Full text index on Dynamics Ax 2012

  • Full text index used only on text fields on table.
  • They find all records from table which contains the key words
  • Queries can be used to and full text index used in range filters
  • If keywords contains spaces then it will used as “Or” operator.
  • X++ select statement cannot use full text index.


Let explore the full text index on our custom table “HSPatientTable”


And we want full index search of FName of above mentioned table. First of all right click on table and from property window set table group property to “Main”.


Now expand the full text Index node of table and create a new full index name it as IdxFName and drag drop the Fname in this index.


Compile and synchronize table so changes reflect at sql server level.


Now create Now Ax job and paste following code there

static void Job1(Args _args)


HsPatientTable patientTable;

Query query;

QueryBuildDataSource queryBDSource;

QueryBuildRange queryBRange;

QueryRun queryRun; 

delete_from patientTable;

patientTable.HsPatientId ="01";

patientTable.FName =" Ali Raza zaidi";


patientTable.HsPatientId ="02";

patientTable.FName =" Ranjah jogi";


patientTable.HsPatientId ="03";

patientTable.FName ="Waseem akahram";


patientTable.HsPatientId ="04";

patientTable.FName ="Shah jii";


patientTable.HsPatientId ="05";

patientTable.FName ="AX guru";


query = new Query();

queryBDSource = query.addDataSource(tableNum(HsPatientTable));

queryBRange = queryBDSource.addRange(fieldNum(HsPatientTable, FName));




// The space character is treated as a Boolean OR.

queryBRange.value("AX jii");



queryRun = new QueryRun(query);

while (queryRun.next())


patientTable = queryRun.get(tableNum(HsPatientTable));

info (" Patient Id: "  + patientTable.HsPatientId + " , Patient Name: " +patientTable.FName);




I used the value “AX jii”. The space between two words consider as Or and in result it will return two records



Today I got strange query from client that we are adding dimensions like Style in “All production Order” list page using Personalization option. Field added into grid but when we close and reopen the form, it disappear from grid. So there is possible issue with dynamics Ax installation.


When I started to investigate, it was only issue with dimension fields ,  if you save any field from Production order it will save, for example If I want to save “BomId”, It is properly save with respect to user and display on grid.


For Dimensions, Please go to View tab and click on Dimension and add Dimension, it will save and will available for all





Hopes this will helps



Yesterday at one of our company client was facing this issue, on every transaction or even on validating the Journal post error popup as

Invalid object name “tempd.dbo.t4887_”.

“Sql statement, select t1.recid from tempdb.”DBO”.t4887_”


I feel that this error is due  tempdb space fill in sql server or temp table created in SQL already exists. It did not let delete or create temp tables inside SQL server.  I solve this issue with following work around.


  1. Stop AOS.
  2. Stop, analysis services, and SSRS services
  3. Stop Sql server and sql server agent ( If running)
  4. Start SQL server.
  5. Start analysis services and ssrs services.
  6. Start AOS.

Last one week this error is not appear on client.


I think there will be planned down time on AX production environment, where AOS and SQL services must be restarted after weekly or monthly basis.