Caching the display methods on Forms in AX 2009

AX Forms with many display methods might have some performance issues. To increase the performance of these kinds of AX forms, the display method written in the table methods need to registered for caching. When the cached method is registered for caching then they perform calculations on fetched data, and then the calculated values are…

Merge two records from one table in AX 2009

In AX 2009, you can merge two records by using the merge() function in a table. For Example if you have posted a project with different department dimensions and now if you would like to merge two records of department dimension then this merge function can be helpful. The sample code is here as follows:…

Rename a Primary Key in AX through code

In this post, I am going to discuss about how to rename a primary key in AX. The renaming can be done for any record using the CCPrimaryKey Class. Let us suppose, if Customer Id 1000 has to be renamed as Cust_1000 then it will be renamed in all the tables(SalesTable, CustTable, SalesQuotationTable etc.,) wherever…

Create Delete Actions through code in AX

Hi Folks, It has been a long time, since I have posted any blog because of my busy project schedule…………. In this post, I am going to discuss on how to create delete actions through code in AX. Let us create a delete action in InventTable for a testTable. SysDictTable table; Treenode treeNode, datreeNode; table…

Get all Error Messages of Infolog in the desired language into a string and return it to external application

If you want to get all the error messages in the infolog in a desired language then just put this small code snippet and run it in a job. infolog.language(LanguageId); then whole UI of AX Client will be changed to the desired language and we will get the error messages into the infolog in that…

Insert / Delete / Update records into an external SQL database from AX using x++

Inserting/Deleting/Updating records into an external SQL database from AX 2009 using x++ can be done using ADO Classes in AX. This can be told from the following code snippet. In the below code snippet CCADOConnection is used to establish a connection with the external database and CCADOCommand is used to execute the command on the…

|

Paging in a Query(Query run)/Paging while retrieving the records from a query

Today, I have a found a new function in QueryRun class and thought of sharing it here in this post. Its use can be found while integrating AX with some external applications. I am sure that everyone has used queryrun class in x++ code. I have found out a special function in QueryRun Class with…

|

Convert pdf or any type of file to base 64 string in AX using x++

Here is a code snippet to convert any file into a base64 string in x++ using some dot net inbuilt classes in AX. To convert it, initially clrinterop permission must be granted to access the dot net inbuilt classes then load the file into file info, initialize the byte array with the length of file,…

|

Store and retrieve an image in a table for a record in AX

The simplest way to store an image for a record into AX tables is by using the CompanyImage Menu Item. I will explain you with an example below: Generally, most of the customers would request for a functionality to store an image for an item. For this, there is no need of high customization. Initially,…