Browse by Tags

When creating a Sales order in Dynamics AX 2012, you can define both a "Customer account" and an "Invoice account". The Customer account identifies the customer for which the Sales order is being created, and the Invoice account references the account number of the customer to invoice, in case it is...

Hello,
When the Foreign currency revaluation process is run, Dynamics AX adjusts the amounts in the General Ledger accounts to recognize possible differences between the exchange rate for the original transaction currency, and the exchange rate that is used during the conversion to the accounting...

Adding controls at runtime can be a powerful feature of Microsoft Dynamics AX client development. As a developer you may choose to display a control based on business logic and one way to do this can be with X++. I had a recent case where attempting this caused the Financial dimension fields to not work...

Introduction
The following steps are one way to collect a series of AX traces on a schedule with all versions of AX 2012 on the AOS server, using standard Windows tools: Perfmon combined with Task Scheduler. This example collects a 1 minute trace at 5 minute intervals.
This can be useful for example...

This is Part 2 of a two part troubleshooting check list for general performance on Microsoft Dynamics AX. This part includes hardware, indexing, queries, blocking and code - at a high level. Please note this is just an outline of key areas for general guidance and not an exhaustive list.
As you have...

Suppose we have many companies in AX 2009 and to simplify the selection of the company list in the Enterprise portal, we can use the below code change to display the company names in an alphabetical order. This will help the AX users to save time in searching and selecting the company name.
Open...

As described here Configuring the Lookup for a Data Set Field [AX 2012] you can change how lookup look like. What you can also do you can range to the lookup to show i.e. only rooms which are in service. Following X++ shows how to achieve this:
void dataSetLookup(SysDataSetLookup sysDataSetLookup...

Conclusion: There are situations where updating index fields while fetching data from the table using the same index can result in the same row being fetched twice. Recommendation here is to avoid updating index fields while selecting records using the same index.
For example:
1) Consider following...

Written some X++ which seems to have high memory usage when run in IL but runs normally when not in IL? Or just noticing high memory usage in servers running IL code?
Here we're going to talk about an aspect of garbage collection in XppIL that is important for anyone writing XppIL code to take on...

In case you need access a global namespace (object without namespace) like following definition, you could use a this X++ code. C# code: namespace KFEnumNamepace { public enum KFEnumNamespaced { ValueNA = 100, ...

Due to popular demand, below is example code that creates a general journal in 2012 using X++ code:
AxLedgerJournalTable header = new AxLedgerJournalTable();
AxLedgerJournalTrans trans = new AxLedgerJournalTrans();
container ledgerDimensions, offsetDimensions;
header.parmJournalName("GenJrn...

Threading in AX 2009 is different from threading in C#. In C# you can spawn up threads and have them do whatever they do. The same thing is available in AX using the Thread class but it isn't the optimal or recommended way to spawn threads in AX. This is because AX has AOS instances and batches. When...

When double-clicking on a record in a list page to see the details of that record in a task page/form and getting this error: Error executing code: Wrong argument type for function.
With a stack trace of:
(C)\Classes\QueryRun\setRecord
(C)\Classes\FormDataSource\executeQuery
Change the query...

To import employees via Excel use a concept similar to the import of customers and vendors but add additional tricks to get the Name and Search name fields from the DirPartyTable populated. (If you are unfamiliar with importing customers and vendors see KB article #960729.)
When defining your Excel...

We recently had a case where the customer wanted to change the language being used for a given AX user at runtime. The customer had sorted out how to change the language displayed in forms and reports but the buttons on the navigation pane were not getting updated. Here is a way to handle this scenario...

This post describes how to call the AIF sales order service from X++ code. The same approach can be used for calling any web service.
In the AOT under the References node add a service reference specifying the wsdl location of the service, a .NET code namespace and a reference namespace. An example...

In AX2009 if you call the research() method on a form passing true, the cursor position within a grid should be retained. However, this is true only if the query created by the form uses inner joins. Any outer joins, aggregations, temp tables, etc. cause the cursor to go to either the first or last record...

It can be unclear as to which tier, either the client or the server, X++ code is executed on. This ambiguity can lead to problems. For instance if you run a server-bound batch, all of the code has to run on the server. If a call is attempted on the client this error will be thrown: "The server-side impersonated...

When troubleshooting a problem it is helpful to have the X++ callstack especially in scenarios where you cannot use the debugger in the environment or the issue happens sporadically. The following X++ code will retrieve the X++ callstack and send it to the infolog. Add the example code to a method that...