Dynamics Ax 2012 Interview Questions and answers

share this interview article on:

Define MorphX ?

The MorphX Development Suite is the integrated development environment (IDE) in Microsoft Dynamics AX used to develop and customize both the Windows interface and the Web interface.


Define  X++  ?

X++ is the object-oriented programming language that is used in the MorphX environment .


Define AOT ?

The Application Object Tree (AOT) is a tree view of all the application objects within Microsoft Dynamics AX. The AOT contains everything you need to customize the look and functionality of a Microsoft Dynamics AX application.


Define AOS  ?

The Microsoft Dynamics AX Object Server (AOS) is the second-tier application server in the Microsoft Dynamics AX three-tier architecture.

The 3-tier environment is divided as follows:

• First Tier – Intelligent Client

• Second Tier – AOS

• Third Tier – Database Server

In a 3-tier solution the database runs on a server as the third tier; the AOS handles the business logic in the second tier. The thin client is the first tier and handles the user interface and necessary program logic.


What is an EDT, Base Enum, how can we use array elements of an EDT?

            EDT - To reuse its properties. The properties of many fields can change at one time by changing the properties on the EDT. Relations can be assigned to an edt are known as Dynamic relations.

EDT relations are Normal and Related field fixed.

Why not field fixed – field fixed works on only between two tables 1- 1 relation. And Related field fixed works on 1- many tables.so edt uses related field fixed.

            BaseEnum - which is a list of literals. Enum values are represented internally as integers. you can declare up to 251 (0 to 250) literals in a single enum type. To reference an enum in X++, use the name of the enum, followed by the name of the literal, separated by two colons . ex - NoYes::No.


Difference between temp table and container?

1. Data in containers are stored and retrieved sequentially, but a temporary table enables you to define indexes to speed up data retrieval.

2. Containers provide slower data access if you are working with many records. However, if you are working with only a few records, use a container.

3. Another important difference between temporary tables and containers is how they are used in method calls. When you pass a temporary table into a method call, it is passed by reference. Containers are passed by value. When a variable is passed by reference, only a pointer to the object is passed into the method. When a variable is passed by value, a new copy of the variable is passed into the method. If the computer has a limited amount of memory, it might start swapping memory to disk, slowing down application execution. When you pass a variable into a method, a temporary table may provide better performance than a container.


Definition and use of Maps, how AddressMap (with methods) is used in standard AX?

Maps define X++ elements that wrap table objects at run time. With a map, you associate a map field with a field in one or more tables. This enables you to use the same field name to access fields with different names in different tables. Map methods enable to you to create or modify methods that act on the map fields.

Address map that contains an Address field. The Address map field is used to access both the Address field in the CustTable table and the ToAddress field in the CustVendTransportPointLine table.


What is the difference between Index and Index hint?

Adding the "index" statement to an Axapta select, it does NOT mean that this index will be used by

the database. What it DOES mean is that Axapta will send an "order by" to the database. Adding the "index hint" statement to an Axapta select, it DOES mean that this index will be used by the database (and no other one).


How many types of data validation methods are written on table level?




How many types of relations are available in Axapta, Explain each of them?

Normal Relation: enforce referential integrity such as foreign keys. For displaying lookup on the child table.

Field fixed: works as a trigger to verify that a relation is active, if an enum field in the table has a specific value then the relation is active. It works on conditional relations and works on enum type of data.

Ex- Dimension table

Related field fixed: works as a filter on the related table.it only shows records that match the specified value for an enum field on the related table.


When the recid is generated, what is its utility?

when the record is entered in the table the recid is generated by the kernel.it is unique for each table.


Difference between Primary & Cluster index?

Primary index: It works on unique indexes. The data should be unique and not null. Retrieve data from the database.

Clustered Index: It works on unique and non unique indexes.retrieve data from the AOS.


The advantages of having a cluster index are as follows:

  • Search results are quicker when records are retrieved by the cluster index, especially if records are retrieved sequentially along the index.
  • Other indexes that use fields that are a part of the cluster index might use less data space.
  • Fewer files in the database; data is clustered in the same file as the clustering index. This reduces the space used on the disk and in the cache.

The disadvantages of having a cluster index are as follows:

  • It takes longer to update records (but only when the fields in the clustering index are changed).
  • More data space might be used for other indexes that use fields that are not part of the cluster index if the clustering index is wider than approximately 20 characters).


How many kind of lookups can be made and how?

              By using table relations

              Using EDT relations.

              Using morphx  and using X++ code(Syslookup class).


How many types of Delete Actions are there in Standard Ax and define the use of each?






What is the function of super() ?

              This method calls the system methods to execute.

It is used to instantiating the variables at the parent class. Used for code redundancy.


Utility and use of find method ?

              All the tables should have at least one find method that selects and returns one record from the table that matches the unique index specified by the input parameters. The last input parameter in a find method should be a Boolean variable called for update or update that is defaulted to false. When it is set to true, the caller object can update the record that is returned by the find method.


What  are the different types of Table groups defined on table properties?









Multiple inheritance possible or not, if not how can we overcome that ?

In X++, a new class can only extend one other class; multiple inheritance is not supported. If you extend a class, it inherits all the methods and variables in the parent class (the superclass).

We can use Interfaces instead of multiple inheritance in Ax.


Do we need to write main method, give reasons ?

Yes, but to open the class from action menu item we have to create main method of class.


 What is difference between new & construct method ?

new(): used to create a memory to the object.

Construct():  You should create a static construct method for each class. The method should return an instance of the class.


What is the utility of the RunOn property ?

Application objects such as reports, tables, and methods can run on the application object server (AOS) or the client. An object can also have the RunOn property value set to Called from. Objects set to Called from can run from either the client or server, depending on where the object is called from. This topic describes the RunOn property, tiers that class objects can run on, and hints about using AOSRunMode.

Default value of RunOn for Classes -                        Called from

                            MenuItems            -             Client


What is main class used in batch process OR which class will you inherit to make a batch job ?

RunBaseBatch  class


How can we make a batch job occur at regular interval  ?

Using RunbaseBatch


What is the main utility of classes in standard Ax ?

For business logic


Which class is called when we create a SO/PO ?

SalesFormLetter and PurchFormLetter


 What is the basic structure of a form ?



Properties of a form datasource?

Name, Table, Index, AllowCheck, AllowEdit, AllowCreate, AllowDelete, StartPosition, JoinSource, LinkType.


When a form opens what are the sequential methods called ?

Form init()

DataSource init()

Form run()

DataSource executeQuery()




Where is the best place to write code to perform filter in a form ?

FormDataSource  - executeQuery() and call this method in the design field of the form.


What are the different types of menu items available, explain each of them ?

Display – for Form

Output  - for Report

Action   - for classes.


Difference between pass by reference and pass by value?

Pass By Reference:
In Pass by reference address of the variable is passed to a function. Whatever changes made to the formal parameter will affect to the actual parameters
- Same memory location is used for both variables.(Formal and Actual)-
- it is useful when you required to return more than 1 values
Pass By Value:
- In this method value of the variable is passed. Changes made to formal will not affect the actual parameters.
- Different memory locations will be created for both variables. 
- Here there will be temporary variable created in the function stack which does not affect the original variable.

In case of pass by value, the change in the sub-function will not cause any change in the main function whereas in pass by reference the change in the sub-function will change the value in the main function.

Pass by value sends a COPY of the data stored in the variable you specify, pass by reference sends a direct link to the variable itself. So if you pass a variable by reference and then change the variable inside the block you passed it into, the original variable will be changed. If you simply pass by value, the original variable will not be able to be changed by the block you passed it into but you will get a copy of whatever it contained at the time of the call.


What are the two most important methods on the Report?



When do block the super() method of fetch?

Don't call super() when overriding the fetch method in a report


Can we make a report from wizard, if yes from where?

Yes, Tools>DevelopmentTools>Wizards>Report Wizard


What is a Programmable Section, how we use it in reports?

Use programmable sections to add any kind of customized information. To activate a programmable section, activate it explicitly with an element.execute(Number) statement. The Number must be specified in the ControlNumber property for the design section.


What is the difference between Auto Design Spec & Generated Design?

Auto Design: An auto design is a report design that has a layout that is automatically generated based on the data for the report. You can use auto designs for most common reports. Reusability is available.

This uses Report template and Section template. Header ,Section Group and Footer is not available.

Generate Design or Precision design: You can create a precision design for a report that requires a very precise layout. It doesn’t use Section template and Report template. Reusability is not available.


How can we sort the DS, what facility we can get in by placing fields in Ranges?



What is the role of executeSection?

You can override the executeSection method for a report section to modify the layout of the section and to modify how the section is printed. If you want to do something before a section is printed, such as go to the next page, this can be coded in the executeSection method.


What are Queries, how do we use them?

You can create a query to retrieve data by using the query classes.


what is Composite query?

A composite query uses another query as its data source. A composite query is similar to class inheritance in X++ or C#. A composite query is a good design choice when one of the following is true:

An existing query lacks only a range that you want to add. An existing query lacks only a method override that you want to add.


What is the use of Parameter, Enum Type Parameter/Enum Parameter properties of MenuItems?

Parameters:   Specify the arguments that are passed to the object. Optional.

Enum TypeParameter and Enum Parameter:   Choose an enumerated type as a parameter for the Object, and then select an enum value as the EnumParameter property. Optional.

These properties are typically used when one form is used in several different situations. You can change the behavior of the form, depending on the EnumParameter value. For example, the PriceDiscGroup form is used by three different display menu items (PriceDiscGroup_*), which each have a different EnumParameter value. In the form's initmethod, a switch construct checks the value, and then the form is created accordingly.


Why do we provide Configuration key & Security Key?

Configuration key: Configuration keys allow administrators to enable or disable features in the application for all users. Disabling features helps to minimize the attack surface against potential attacks.

Configuration keys are applied to:

  • Tables
  • Fields
  • Indexes
  • Views
  • Menus
  • Menu items
  • Form controls,
  • Report controls
  • Extended data types
  • Enumerations


Security key: Security keys allow administrators to set security on a user group level. Minimizing access on a user group level helps to reduce the attack surface against potential attacks.

The main reasons to apply user-level security are to:

Allow users to do only their designated tasks.

Protect sensitive data in the database.

Prevent users from inadvertently breaking an application by changing code or objects on which the application depends.

You need to apply a security key to:

  • Tables
  • Views
  • Menus
  • Menu items
  • Form controls
  • Report controls


Normally what do we attach in Output ?



Normally what do we attach in Action ?



What is difference between select & select firstonly statements?

The select statement fetches or manipulates data from the database or both fetches and manipulates data from the database. Results of a select statement are returned in a table buffer variable.

If you are going to use only the first record or if only one record can be found, use the firstOnly qualifier. This optimizes the select statement for only one record. Do not use while select firstOnly.

It is a best practice to use the firstOnly qualifier in find methods on tables.


 What are the keywords used to access data from "multiple companies" and "one company to another company"?

A cross-company query returns data for several companies in a single run.

To create a cross-company query:

In X++, use the crossCompany keyword on the X++ select statement.

In X++, set the allowCrossCompany property method to true on an instance of the Query class.

In the AOT, set the AllowCrossCompany property to Yes on a node under Query.


How can we override a lookup?

AOT>Form>DatasSource>Fields>FieldName >Lookup



How do the following methods work in a form DS?
ds.refresh(), ds.research(), ds.reread(), in what situation we should use these methods

Refresh():  Updates the form by refreshing the view of all records in the data source.

Research():  Rereads the current record from the database.

Reread():   Refreshes the database search defined by the query, specified by the FormDataSource.init method.


On closing a form name the methods which are invoked?





What are the classes, Tables, Forms and Methods used to post the sales orders?

SalesTableType and SaleslineType classes will get called while creating the orders.

SalesFormLetter* classes will be used to post the sales order at various document status(packing, invoice etc).

SalesParm* tables are used to prepare the data for posting

CustConfirmJour, CustConfirmTrans - when a sales order gets confirmed

CustPackingSlipJour, CustPackingSlipTrans - when a packing slip is posted.

CustInvoiceTable,CustInvoiceTrans - when an invoice is posted.


What is the difference between RunBase and RunBaseBatch?

RunBase: To create a job or an Action class - a program that carries out processes, such as accepting parameters from the user and then updating records in the database - you use the RunBase framework.

The framework is implemented by the RunBase application class and supplies many features, which include the following:

  • Query
  • Dialog, with persistence of the last values entered by the user
  • Validate

The RunBase class is a framework for classes that need a dialog for user interaction and that need the dialog values to be saved per user.

RunBaseBatch:  You can design your own batch job by extending the RunBaseBatch class. You can also write code to schedule the batch to run. The batch runs on the Application Object Server (AOS)


What is the difference between Insert and doinsert?

Insert(): To insert  the records into the database. Secure any related transactions with tts.

Doinsert():These methods should only be used under strict control because they bypass the following:

Any validations that have been set up.

Any code that was written in the insertupdate, and delete methods.


Difference between sql and x++ statement ?

  1. Table buffer on the FROM in x++ clause ,not the table as in SQL
  2. ORDER BY clause precedes the WHERE clause
  3. ! for negation ,not NOT as in SQL
  4. && and || for logical operator ,not AND or OR as in SQL.
  5. * and ? for like wildcards ,not % and _ as in SQL.


  1. Join clause has no ON keyword in x++,use WHERE instead
  2. Default JOIN direction is left .
  3. there are no LEFT and RIGHT keyword for JOIN in x++
  4. The FROM clause is optional when:

-No column is listed or
-Only one table is listed in the SELECT in x++

select * FROM CustTable;
select CustTable;              both are same.

1.The WHILE SELECT statement provides an automatic cursor for return rows in x++
2.There is no HAVING keyword in x++
3.No null values are return in x++


How many types of classes are there?

System Classes and Application Classes.


Development tools?

Version control , Cross-reference, Code profiler, Debugger, Application Hierarchy Tree,Code Explorer, Reverse Engineer, Number of Records, Embedded Resources,  Wizards, Label.


What is the difference between sql queries and dynamics queries?

Sql query is Select statement –

Dynamic query – AOT Query and Query class using x++.


What is JumpRef()?

The user activates the Go to main table command from the shortcut menu on the control or by pressing CTRL+ALT+F4. The super() call opens the main table that contains data for the field.


How to design a form in AX using X++?

The Form* classes enable you to manipulate, create, modify, or run forms by using X++ code. You can also modify forms during run time so, for example, one or more controls are hidden on a form, depending on the user's selections in the preceding form.

The Form classes are all system classes and are prefixed with Form.

Form, FormRun, FormDesign, FormBuildDesign, FormDataSource, FormBuildDataSource, FormControl



Difference between bound and unbound controls?

Form controls belong to one of three groups, depending on their data source as follows:

  • Bound control – associated with a field in an underlying table. Use bound controls to display, enter, and update values from fields in the database.
  • Unbound control – does not have a data source. Use unbound controls to display pictures and static text.
  • Calculated controls – uses a method as the data source. An example of a calculated control is the sum of two fields on a form.


How to create runtime query?

You can create a query to retrieve data by using the query classes.

Query, QueryRun, QueryBuildDataSource, QueryBuildRange, QueryBuildLink,  QueryBuildDynaLink

 What is optimistic concurrency control and Pessimistic Concurrency Control?

Optimistic Concurrency Control (OCC) helps increase database performance. Pessimistic Concurrency Control locks records as soon as they are fetched from the database for an update. However, Optimistic Concurrency only locks records from the time when the actual update is performed.

Following are the advantages of using OCC:

  • Fewer resources are used to hold the locks during the update process.
  • Records are locked for a shorter length of time.
  • Records remain available for other processes to update if they have been selected from the database but haven't yet been updated.

The disadvantage of using OCC is that the update can fail if another process updates the same record. If the update fails, it must be retried. This can lead to a reduction in database performance.

OCC makes it possible for other processes to update a record even after it has been fetched. You can catch update conflicts by catching the UpdateConflict and UpdateConflictNotRecovered exceptions.


What are macros?
              Macros act as a container for defining variables used for frequent tasks. The purpose of macros is to make statements easy to reuse. A macro can’t be executed independently as a class.

An advantage macro is that the maintenance is done in only one place.

Three types of macros

Macro libraries – is a standalone macro that contains a collection of local macros.

Standalone macros – is created by using the macro node in the AOT.

Local macros  -  is declared with in a method.

Related Interview Questions