You are on page 1of 25

Q.1) Tell me about yourself in brief?

Q.2) Modules you are involved while customization?

Q.3) What are mandatory Table Properties?


Ans: Table Name, Primary Index, Cluster Index.

Q.4) What is an Index?


Ans: An index is a table-specific database structure that speeds the retrieval of rows from a table. Indexes
are used to improve the performance of data retrieval and occasionally to ensure the existence of unique
records. Like most database objects in Microsoft Dynamics AX, indexes are synchronized with the
database. Once created, indexes are managed automatically by the DBMS every time a record is inserted,
updated, or deleted.

When selecting table fields for an index consider the following:


• Fields that are often searched by a range.
• Fields that frequently participate in joins.
• Fields that are frequently used to order or group a result set.
There are two types of indexes: unique (Allow Duplicates :No) and non-unique.
To disable the index, set the Enabled property to No. When you disable an index, it is deleted from the
database.
You can also delete an index by right-clicking the index, and then clicking Delete.

Q.5) How to create a Primary Key?


Ans:A primary key is one type of key. The other type of key is an alternate key. There is a maximum of one
primary key per table, whereas a table can have several alternate keys. The primary key is usually the type
of key that other tables, called child tables, refer to when a foreign key field in those other tables need a
relational identifier.
Starting in Microsoft Dynamics AX 2012 the primary key for every new table is always enforced by an
index that has exactly one field. The one field is usually an incremented number or a completely
meaningless number that is generated by the system. For new tables the default is a primary key based on
the RecId field. This is represented as the surrogate key in the user interface.
PrimaryIndex The drop-down list contains the surrogate key plus every index on the table that
has itsAlternateKey property set to Yes.
In Primary key paragraph, in the table with table properties, Primary index info is not fully true. Primary
index property on tableonly allows to select a "single-column" alternate unique index (key), not all
alternate keys.

Q.5.a) What is an Alternate Key?


A table can have several alternate keys. Any one alternate key can switch to being the primary key, if the
alternate key is comprised of only one field.
A table can reference the alternate key of another table. However, it is more common for a table to
reference the primary key of another table. As an option, an alternate key can be chosen as
the ReplacementKey of a table.
In practice each alternate key relies on a unique index for its implementation and enforcement. However,
a unique index alone does not make an alternate key. The AlternateKey property must be set to Yes to
make a unique index be an alternate key.
The following table describes properties on the AOT node for an index.
Property Description
AllowDuplicates No means that the combined fields of the index must together make a value in
each record which no other record has.
AlternateKey Yes means that other tables can create foreign key relations that reference this
key, as an alternative to referencing the primary key.
Indexes with two or more fields cannot have their AlternateKey property value
set to Yes.
In Alternate key paragraph, in the table the following information is not true: "Indexes with two or more
fields cannot have theirAlternateKey property value set to Yes." They can.

Q.5.b)What is an Replacement Key?


Ans) ReplacementKey
A replacement key is an alternate key that the system can display on forms instead of a meaningless
numeric primary key value. Each table can have a maximum of one replacement key.
The replacement key is chosen by setting the ReplacementKey property on the table. The drop-down list
offers every alternate key as an available value.

Q.5.c)What is Primary Key, Replacement Key, Unique Key, Natural Key?


Ans) Primary Key
The primary key is usually the type of key that other tables, called child tables, refer to when a foreign key
field in those other tables need a relational identifier.
When we create a new table in AX2012 the Primary key was enforced by an index that has one field, this
field should be unique, by default the primary key is based on Recid field. This is represented as
surrogateKey in the table properties primary index.
By default the CreateRecIdIndex property was true and ClusterIndex as surrogateKey.
The ClusterIndex value is given to the underlying Microsoft SQL Server database system as a
performance tuning choice. This choice generally controls the physical sequence in which the records are
stored in the underlying database.

ReplacementKey
This key is used to define the replacement fields to display in your design when you referred to
some relation using the Recid.
ex:-
Table B is referring to Table A where the TableB have the Refrecid from Table A, but when you open the
form for TableB We cant show the Recid of the TableA in the Presentation,So whatever the field that you
want to display, you will define one index on TableA with the fields that you want to show and and index
alternateKey property to Yes. define the Replacement key property for the table A as this index.
If a ReplacementKey is chosen, its fields can appear on forms to helpfully identify each record.
The ReplacementKey should be a set of fields that represent the natural key.

In AX2012 Relation represents a foreign key.


Foriegn Key-In Microsoft Dynamics AX, an AOT node under MyTable > Relations represents a foreign
key.
natural key-A key whose value has meaning to people. Most replacement keys are natural
keys.(ReplacementKey).
unique key-this applies to primary keys and to alternate keys. It does not apply to foreign keys. This term
emphasizes that all values for a given key must be unique within one table. All fields in a unique key must
be not-nullable.

Q.6) What are the relations available in AX 2012? Differentiate each of them?
Ans) Define conditional table relations to filter the records in either the primary or the related table.
Following are the conditional table relations that can be specified when you define the fields in a table
relation:
• Field fixed
• Related field fixed
Relation
Format Description
Type
Field fixed Field fixed Restricts the records selected in the primary table.
(Table.Field == Only records that meet the condition are selected.
<EnumValue>) The condition is ANDed with your relation.
Related field Related field fixed Restricts the records selected in the related table.
fixed (<EnumValue> == Only records that meet the condition are selected.
Table.Field) The condition is ANDed with your relation.

· Normal to specify relation fields without conditions.


· Field Fixed to specify relation fields to restrict the records in the primary table.
· Related Field Fixed to specify relation fields that restrict the records in the related table.

1. For Normal, enter the following in the Field Relation property pages:
· In the Field property, select the field in the primary table that relates to a field in the related table.
· In the Related Field property, select the field in the related table.

2. For Field Fixed, enter the following in the Field Relation property pages:
· In the Field property, select the field in the primary table to use to restrict the records.
· In the Value property, enter the value of the selected field as the filter. This relates only records in the
primary table that match that field value. Only numeric values can be entered in the Valueproperty. Field
fixed relations can be created only on numeric fields.
Each of the related fields are ANDed in the table relation.

3. For Related Field Fixed, enter the following in the Field Relation property pages:
· In the Value property, enter the filter value of the selected field. This causes only records in the related
table that match that field value to be related. Only numeric values can be entered in the Valueproperty.
Related field fixed relations can be created only on numeric fields.
· In the Field property, select the field in the related table to restrict the records.

Each of the related fields are ANDed in the table relation.

Q.7) What are the Delete actions available in AX 2012? Explain them?
Ans) Delete actions on a table are used for two purposes
• Restrict the deletion of a record based on related records in another table
• Cascade the deletion of a record to related tables to ensure data-consistency
There are four different types of delete actions
• None
• Cascade
• Restricted
• Cascade+Restricted
None
A None deletion action will delete selected row in the table but nothing occurs to the table that relate to
this table.

Cascade
A cascading deletion action will delete all records in the related table, where the foreign key is equivalent
to the primary key of the current table. That is, deleting the ''parent'' record will also delete the ''child''
record(s) in the related table.
This cascading will take place whether the deletion is performed in code or directly by a user through the
user interface.

Restricted
A restricting delete action will raise an error message if the user tries to delete a record, where records
exist in the related table where the foreign key is equivalent to the primary key of the current table.

This error will only appear if the deletion is performed through the user interface. A deletion from X++
code will be allowed to proceed and will '''not''' be cascaded to the related table. In this case the
programmer should call .validateDelete() themselves prior to the call to .delete()

Cascade+Restricted
The delete action performs an restricted, if the record of the table will be deleted directly and performs an
cascade, if the record of the table will be deleted through a cascade delete action of a other table.
e.g.:
tableA (Customer) (a cascade deleteaction to tableB)
tableB (SalesOrder) (a cascade+restricted deleteaction to tableC)
tableC (SalesLine)

When a record of tableB will be deleted, the restricted part of the deleteaction will be performed. The
record of tableB can only be deleted, if no record in tableC exist for the record in tableB. (The SalesOrder
can only be deleted, if no SalesLine exist for the SalesOrder).
A record in tableA will be deleted, so the cascade deleteaction to tableB will be performed. In this case,
the cascade part of the deleteaction to tableC will be performed. (When a Customer will be deleted, the
SalesOrders and SalesLines will also be deleted)

So, the performing action of a cascade+restriced deleteaction depends on the kind of deletion of the
record. (direct:restricted, cascading:cascade)
Restricted Vs Cascade + Restricted Example:
Suppose we have 3 table , table1 , table2 , table3
Scenario 1 :
Table1 is having a restricted delete actions with table2 and table3 is having a cascadedelete action with
table1.
Now if we try to delete the record in table3 , and if record exists in table2 , we will get error
“The record may not be deleted. Transactions exist in table ‘Table2′.”
Scenario 2:
Table1 is having a cascade + restricted delete actions with table2 and table3 is having a cascade delete
action with table1.
Now if we try to delete the record in table3 , and if record exists in table2, records will be deleted from
table 3 , table 1 and table 2 as well.
One more thing , if you will try to delete the data from table1 and record exist in table2 , you cannot
delete the data in table1 (now cascade + restricted will behave like restricted)
Scenario 3:
we have three tables Person ,Customer & Order
Now Person is a parent of Customer table, and Customer is a parent of Order table having (One-To-
Many) relations.
If I set a Delete action property on Person table to “CASCADE” for customer table and If I set a Delete
Action property on a CUSTOMER table for Order table to “CASCADE +RESTRICTED”.
So if I delete a record from Customer table then It will first check the record in the child table(order table)
and if exist that warning prompt saying that first we need to delete a record from child table.
But if I delete a record from Person table it will automatically delete a record in Customer table and all
records related to customer table in Order table would also be deleted.
The Cascade+Restricted delete action is used in the standard application for LedgerJournalTrans on
LedgerJournalTable.
This type of delete action is useful when you prefer a total clean-up—when you delete a customer, you
also delete all the transactions associated with that customer.

Q.8) Use of methods in table level?


Ans) The use of methods at the table level is to write business logic or calculation / validation associated
with the table.

Q.9) What are the mandatory methods for a Master Table?


Q.10) Difference between Index and Index Hint?
Ans) Index is used for fast retrieval of records from the database, Use of Index allow the database to
choose the index other than one specified by the user, where as the Index Hint lets the database to use
this index only.

Q.11) What is Table Group Property?


Ans) Table groups provide a method for categorizing tables according to the type of data they contain.
Use:When exporting data, you can use table groups to filter records.
For example, if you wanted to specify that customers should be exported but customer transactions
should not. The table group that a table belongs to is defined by the TableGroup property of the table.
The groups available are defined by the system Enum TableGroup.

Parameter:
The table contains data primarily used as parameters or setup information for one of the main tables (a
table that has aTableGroup property of Main).
The table typically contains only one record per company.
Ex: CustParameter, VendParameter

Group:
The table contains data primarily used to categorize one of the main tables (a table that has
a TableGroup property ofMain).
There is a one-to-many relationship between a Group table and a Main table.
Ex: CustGroup, VendGroup

Main:
The table is one of the principal tables in the application and contains data for a central business object.
The table typically holds static, base information.
There is a one-to-many relationship between a Main table and a Transaction table.
Ex: CustTable VendTable

Transaction:
The table contains transaction data. The table is typically not used for data entry directly.
Ex: CustTrans, VendTrans

WorkSheetHeader:
The table typically categorizes information in the WorkSheetLine tables.
There is a one-to-many relationship between a WorkSheetHeader table and a WorkSheetLine table.
Ex: SalesTable

WorkSheetLine :
The table contains information to be validated and made into transactions.
In comparison to the data contained in a Transaction table, the data in WorkSheetLine tables is temporary
and may be deleted without affecting system stability.
Ex: SalesLine

Miscellaneous:
The table does not fit in any of the other categories. This is the default value for a new table.
Ex: TableExpImpDef
Q.12) What is the difference between Transaction Table and Worksheet Line?
Ans) The table contains transaction data. The table is typically not used for data entry directly.
Ex: CustTrans, VendTrans

The table contains information to be validated and made into transactions.


In comparison to the data contained in a Transaction table, the data in WorkSheetLine tables is temporary
and may be deleted without affecting system stability.
Ex: SalesLine

Q.13) What is the table group used for Setup tables?


Ans) Parameter table stores the setup information for a legal Entity/company.s

Q.14) How to create a Number Sequence?


Ans) steps:
1. Create an edt : CarId .
AOT >> Extended Data Types >> New >> Properties >> Name >> Car Id.
2. Write a code on lode module() on NumberSeqModuleProject
{
datatype.parmDatatypeId(extendedTypeNum(Car Id));
datatype.parmReferenceHelp(literalStr("@SYS334483"));
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmWizardHighest(999999);
datatype.parmSortField(20);
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
}
3.Write a method on Projparameters Table

client server static NumberSequenceReference numRefcarId()


{
return NumberSeqReference::findReference(extendedTypeNum(car Id));
}
4.Write a job and run that

static void Carid(Args _args)


{
NumberSeqModuleProject NumberSeqModuleProject = new NumberSeqModuleProject();
;
NumberSeqModuleProject.load();
}
5. Then run the wizard
Organization Administration >> CommonForms >> Numbersequences>>Numbersequences>>
Generate >> run the wizard.

6.Now we have to check the number sequence is correctly working for that write a job:

static void number(Args _args)


{
NumberSeq numberSeq;
CarId num;
;
numberSeq = NumberSeq::newGetNum(ProjParameters::numRefcarId());
num = numberSeq.num();
info(num);
}

Run the above job.We will find the generated Number sequence. .

7. Now we want that Number Sequence in form level(Car Table):

Declare the number sequence On Form Declaration:

public class FormRun extends ObjectRun


{
NumberSeqFormHandler numberSeqFormHandler;

8. Write the NumberSeqFormHandler() in form methods node.


NumberSeqFormHandler numberSeqFormHandler()
{
if (!numberSeqFormHandler)
{
numberSeqFormHandler =
NumberSeqFormHandler::newForm(ProjParameters::numRefcarId ().NumberSequenceId,
element,
CarTable_DS,
fieldNum(CarTable, Car Id)
);
}
return numberSeqFormHandler;
}
9.Write the close() on the form methods node.
void close()
{
if (numberSeqFormHandler)
{
numberSeqFormHandler.formMethodClose();
}
super();
}
10. Then final add the below methods on data source methods node
Create()
void create(boolean append = false,
boolean extern = false) // If created externally
{
element.numberSeqFormHandler().formMethodDataSourceCreatePre();

super(append);

if (!extern)
{
element.numberSeqFormHandler().formMethodDataSourceCreate(true);
}
}
Delete()
public void delete()
{
element.numberSeqFormHandler().formMethodDataSourceDelete();
super();
}

Write()
public void write()
{
super();
element.numberSeqFormHandler().formMethodDataSourceWrite();
}
Validate Write()
public boolean validateWrite()
{
boolean ret;
ret = super();
ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret) && ret;
if (ret)
{
CarTable.validateWrite();
}
return ret;
}
Link Active()
public void linkActive()
{
;
element.numberSeqFormHandler().formMethodDataSourceLinkActive();
super();
}
Now our numberseqence is generated .
*** Set the field or Tabpage Allowedit property to No.
***Check the continues on wizard.

Q.15) How many types of Queries in AX 2012?


Ans) There are 3 types of Queries in Ax 2012
• AOT Query

• In line Query (SQL Query)

• Dynamic Query

Q.16) What are the main classes that should be called while creating an X++ Query?
Ans) There different classes called while creating the dynamic query are
Query, QueryRun, QueryBuildDataSource, QueryBuildRange, QueryBuildLink

Q.17) How to relate datasources in AOT Query?

Q.18) What is a View?


Ans) Like a table, a view uses fields and rows to represent data records. However, the data in a view is not
stored as a database object but is dynamically created when the view is accessed. A view uses a query to
retrieve data fields from one or more database tables.
In Microsoft Dynamics AX, you can use views where you use tables. For example, you can use a view in a
form, a report, and in X++ code. The following table shows the benefits of using a view instead of a table.
Benefit Description
Focused data A view enables you to retrieve and return only the data that is relevant for a
particular user or scenario.
Customized A view enables you use a complex query to create a highly-customized set of
data data. For example, a view often represents data as a single table that was
retrieved from multiple joined tables and used many conditions.
Performance A view can improve performance by returning only relevant fields to the user. In
addition, a view definition is compiled which may provide better performance
than calling an equivalently complex query.
When you create a view, the view definition is generated and stored in the database. When that view is
accessed, the view dynamically retrieves the data that satisfies the view definition.

Note

Views are read-only. The data fields and tables that a view uses cannot be updated from that view.
Views are synchronized like tables. When you synchronize a view, the view definition is saved to the
database. Synchronization of an existing view causes the definition of that view to be dropped and re-
created in the database.
To use X++ code to retrieve cross-company data from a view, you have to use
the crossCompany keyword in the X++ select statement. For more information about how to retrieve
cross-company data that uses a view, seeCross-Company Queries for Views.
View Elements
Views are located in the Application Object Tree (AOT) under the Data Dictionary\Views node. A view
contains four primary nodes:
• Metadata
• Fields
• Field Groups
• Methods
Metadata
The Metadata node contains the query or data source that the view uses to retrieve data. A metadata
query or data source is referred to as the view query. For more information about how to use a query or
data source, see the View Query section later in this document.
Fields
The Fields node specifies the data fields that the view returns. For example, the data source for the view
namedLedgerCustPaymProposal retrieves many fields from the table named LedgerJournalTrans.
However, the view returns a small subset of the available fields. For more information about how to add
fields to a view, see How to: Create a View Based on a Query.
A view can return aggregate fields that use the functions SUM, MIN, MAX, AVG, and COUNT. Field
aggregation is specified in the Aggregation property of the field. In Microsoft Dynamics AX, views support
only field-level aggregation.

Note

To use the aggregation functions of COUNT, AVG, or SUM, the data field must be a data type
of Integer or Real. If you try to use one of these aggregation functions on a field of any other data
type, you will receive an error.
Field Groups
The Field Groups node contains the field groups for a view. A field group enables you to associates fields
that logically belong together into named groups. Field groups in views work just like they do in tables.
However, you can only add fields to a field group if those fields are returned by the view (each field must
be located in the Fields node of that view). For more information about field groups, see Best Practices for
Field Groups, Defining Field Groups, and How to: Create a Field Group.
Methods
The Methods node displays all the methods available from a view. Use this node to add a new method or
override methods on the xRecord kernel class. Methods enable you to add code that customizes a view.

Q.19) What is the difference between View and Query?


Ans) In query we can add datasource within datasource, where as in a view we cannot add datasource
within datasource.

Q.20) What is the use of Metadata in View?


Ans) The Metadata node contains the query or data source that the view uses to retrieve data. A
metadata query or data source is referred to as the view query.

Q.21) How to relate datasources on a view?

Q.22) Usage of Surrogate Key in relations?


Ans) Surrogate key is a system generated key and it can also be called as RecId, in the earlier versions of
AX 2012, it is not a best practice to have a relation with surrogate keys, as it is a sequential and not a user
identifiable, and we cannot use it on to the form, but with the arrival of Replacement key, it is a best
practice to use surrogate key in the relations.
Ex: UnitOfMeasure, UnitOfMeasureTranslation have surrogate key relation.

Q.23) How to extend a table?


Ans) Create an InstanceRelationType field of Type Int64 in the Parent Table.
Set the following properties on the Parent table and Child Table:
Parent Child
Support Inheritance : Yes Yes
InstanceRelationType: InstanceRelationType Field ---
Extends: --- ParentTable

Q.24) What is the use of form?


Ans) Form is a user interface through which a user interacts with the data or forms are a means of
providing data to the user.

Q.25) How to set datasources on a form?


Ans) Datasource on a form can be set in many ways, either adding tables / views directly to the
datasource of the form or using a AOT as a datasource (only for listpage).

Q.26) How to set table and extended table on a form?

Q.27) How many form templates are available in AX 2012?


Ans) There are 8 types of form templates:
ListPage
DetailsFormMaster
DetailsFormTransaction
SimpleList
SimpleListDetails
Dialog
DropDialog
TableOfContents
Q.28) Which form type is used to create a Parameter Form?

Q.29) Explain about Join Types or Link Types on Forms?


Ans) The following are the different Join Types on a form:
Inner Join
Outer Join
Exists Join
Not Exists Join
Active
Passive and
Delayed
Here I have created Two Tables 1.Master 2.JoinDetail

I have created a Form using the above two tables. This form demonstrates the effects of joining two
datasources in a form.
Setting the property JoinSource and LinkType in form JoinDetail DataSources level

InnerJoin: Retrieves a record from the main table that matches records in the joined table and vice versa.
There is one record for each match. Records without related records in the other data source are
eliminated from the result.

OuterJoin: Retrieves records from the main table whether they have matching records in the joined table.

ExistJoin: Retrieves a record from the main table for each matching record in the joined table.
The differences between InnerJoin and ExistJoin are as follows:
• When the join type is ExistJoin, the search ends after the first match has been found.
• When the join type is InnerJoin, all matching records are searched for.

NotExistJoin: Select records from the main table that do not have a match in the joined table.

Active: The data source is updated immediately when a new record in the parent data source is selected.
Continuous updates consume lots of resources.

Passive: Linked child data sources are not updated automatically. Updates of the child data source must
be programmed on the active method of the master data source.
Delayed: A pause is inserted before linked child data sources are updated. This enables faster navigation
in the parent data source because the records from child data sources are not updated immediately.
For example, you can scroll a list of orders where you do not want to review the lines associated with the
order until you stop scrolling.

Q.30) Difference between IsLookup and CacheLookup on table?


Ans) Single Record Caching or Set Based Caching.
Client or Server Caching.
NotInTTS
Found
Found & Empty
Entire Table
Q.31) How to set form title with record information?
Ans) We have TitleField1 & TitleField2 properties available at the table properties, setting both the
properties can have record information on to the form title.

Q.32) Method Calling sequence on form datasource?


Ans) Init(), LinkActive(), ExecuteQuery(), Active().

Q.33) When to override methods on controls?

Q.34) Usage of Classes in AX 2012?

Q.35) What is an Abstract Class?

Ans) An Abstract Class does not have implementation, i.e., there is no body in a method. And we cannot
modify an abstract class directly, we have to inherit it and write the implementation in the extended class.

Q.36) What is inheritance and how to implement it?


Ans) Inheritance is used to inherit the properties of a class, we can implement the inheritance using the
keyword Extends. Below is the example of the same
Class ClassB extends ClassA
{
}
Q.37) How to implement multiple inheritance in AX 2012?
Ans) Multiple inheritance is not possible in AX, Using Interface we can overcome multiple Inheritance.
Below is the example of the same.
Class ClassD implements ClassA, ClassB, ClassC
{
}
Q.38) Difference between normal methods and static methods?
Ans) In a class to call a normal method we have create an instance/Object of that class and call that
method, Example
ClassA ClassObj = new ClassA()
ClassObj.normalMethod()
Where as a static method can be called directly without creating the instance/Object of that class, directly
by Class name. The static methods are preceded with the keyword Static.
ClassA::staticMethod(); - it is called using the Scope Resolution Operation(::)
And the same is the case with Tables in Ax.
Q.39) How to make a Class executable?
Ans) Main() method is used to make the class self executable.

Q.40) What are the precautions to consider while writing a class?

Q.41) What is the calling class while posting invoices from Accounts Payable and Accounts
Receivable?
Ans) Accounts Receivable Accounts Payable
SalesFormLetter PurchFormLetter
SalesFormLetter_Invoice PurchFormLetter_Invoice

Q.42) Can we post Packing Slip without confirming Sale Order?

Q.43) Explain about the complete cycle of PO and SO?


Ans) Sales Order Purchase Order

Create Sales Order Create Purchase Order


Sales Order Confirmation Purchase Order Confirmation
Sales Order Picking List Purchase Order Receipt List
Sales Order Packing Slip Purchase Order Packing Slip
Sales Order Invoice Purchase Order Invoice

Q.44) How many ways can we use to make payment to a vendor?

Q.45) What is the class used for invoice settlement in AP?


Ans) PurchFormLetter_Invoice

Q.46) What are inventory dimensions?


Ans) Product dimensions/Item dimensions: Color, Size, Configuration
Storage dimensions: Site, Warehouse, Location, Pallet ID
Tracking dimensions: Batch number, Serial number

Q.47) What are item dimensions?


Ans) Product dimensions/Item dimensions: Color, Size, Configuration

Q.48) What are financial dimensions?


Ans) The different financial dimensions are:
Department, CostCenter, Purpose, BusinessUnit

Q.49) Do you know how to setup a new dimension in AX 2012? If “Yes” explain in brief?
Ans) To setup financial dimensions. Go to General Ledger Module > Setup > Financial Dimensions >
Financial Dimensions

Q.50) Difference between item and service item?

Q.51) What is the methodology that you followed while implementing module?

Q.52) What is the use of passing arguments?


Q.53) Explain about Security in AX 2012?

Q.54) When to prepare TDD? Is it before development or after development?

Q.55) Explain about Event Handling in AX 2012?

Q.56) How to do DMF?

Q.57) What are the classes that are useful for creating SSRS Reports?
Ans) Different classes used for creating SSRS Reports are RDP class, Contract Class, Controller Class, UI
Builder Class.

Q.58) Is it mandatory to create a contract class?


Ans) Contract class is only used to pass arguments to the report, based upon which the report values gets
filtered. It is not mandatory to have contract class.

Q.59) Why to use Temporary Tables for reports?


Ans) Temporary tables are used to store the values fetched from the database.

Q.60) How many temporary tables can be used for creating reports?
Ans) We can use any number of temporary tables in a report.

Q.61) What is the main method that fills data for report?
Ans) ProcessReprot() is the main method that fill the data.

Q.62) On the report header section, there are two combo boxes, 2 nd combo box values to be filled
according to the modified 1st combo box’s value, and based on the 2nd combo box’s selected values
need to generate the report. Where to write the logic for the combo boxes?
Ans) In a controller class, we have several methods, we can write the code in a build method of a
controller class.

Q.63) What is the use of Controller Class?


Ans) Controller class is used to control the design of a report. We can change the design based upon the
enum parameters.

Q.64) Explain about deploying techniques of SSRS Reports?


Ans) There are several methods to deploy a report.
AOT > Reports > SSRS Reports > Right click on the report and Deploy report. / Navigate the report to be
deployed and deploy report.
Using command mode “Publish-AXReport –ReportName ReportName / *”.

One can also deploy the report in the Visual studio, In the solution explorer > right click the report and
deploy the report, then add the report to the AOT

Q.65) What is the use of Report Layout Templates?


Ans) Report Layout Template is a style template for the design in a report.

Q.66) Difference between Auto Design and Precision Design?


Ans) Auto design is used to get the data in a pre defined format of a report, be it Table, Pie Chart /
doughnut, matrix, etc., we cannot get the logo of the company in the header of auto design, where as in
precision design, we can design the layout style of the report, and have the logo in the header section,
etc.,

Q.67) Explain about the MenuItem properties to be set for a SSRS Report created from Classes?

Ans) Different menuItem properties to be set for the desing are:


ObjectType: SSRS Report
Object: “Name of the Report”
DefaultDesign: “ Design of the report”
EnumParameterType: “SRSReportOperationMode”
EnumParameter:

Q.68) Difference between Menus and Menu Items?


Ans) MenuItem is an access point of the form/Report, where as Menu is the navigation point of the
menuItem in a module.

Q.69) What is the use of Model and Model Store?


Ans) Model holds the solution in a given layer, we can have several models in a layer, every element in
the AOT should belongs to one model, but no element should belongs to more than 1 model. Models
holds elements in the AOT.
Model Store : A Model Store stores the customization.

Q,70) Explain about Version Control System in AX 2012?


Ans) The following are some version control in AX.
MorphX VCS
TFS ( Team Foundation Server)
MorphX

Q.71) What are the Locking Mechanisms available in AX 2012?


Ans) There are 2 types of Locking mechanism available in Ax, they are OCC & PCC
OCC(Optimistic Concurrency Control) : While updating the record into a table, the occ locks the table so
that no other user access the record during the update process. This OCC locks the table when the actual
update process starts till it finishes. It uses less time and less resources.
PCC(Pessimistic Concurrency Control) : The PCC locks the table, when the user access the table, till it
releases. It uses more time and use more resources.

Reference Blog for Below Questions: http://axapta4u.blogspot.in/2014/09/tablegroup.html

Q.72) Explain about Collection Classes in AX 2012?


Ans) In AX collection classes have been designed for storing objects.
The classes are implemented in C++ to achieve the maximum performance (they are system classes).
collection classes are extended with Object class.

Array: Similar to the X++ language array type except that it can hold values of any single type, including
objects and records. Objects are accessed in a specific order.
http://msdn.microsoft.com/EN-US/library/array.aspx

List: Contains any number of elements that are accessed sequentially.


Lists are structures that can contain values of any X++ type.
All the values in the list must be of the same type.

http://msdn.microsoft.com/EN-US/library/list.aspx

Map: The Map class allows you to associate one value (the key) with another value.
Both the key and value can be any valid X++ type, including objects.
The types of the key and the value are specified in the declaration of the map.
The way in which maps are implemented means that access to the values is very fast.

http://msdn.microsoft.com/EN-US/library/map.aspx

Struct: A struct holds several values of any X++ type, to group the information about a specific entity.

http://msdn.microsoft.com/EN-US/library/struct.aspx

Set: The Set class is used for the storage and retrieval of data from a collection in which the values of the
elements contained are unique and serve as the key values according to which the data is automatically
ordered.

http://msdn.microsoft.com/EN-US/library/set.aspx

Changes to the Collection Classes in Dynamics AX 2012

http://blogs.msdn.com/b/x/archive/2011/09/07/changes-to-the-collection-classes-in-dynamics-ax-
2012.aspx

Q.73) Why Container is not treated as a collection class?

Q.74) Which Collection Class is faster for retrieving data?

Ans) Set is faster when compared to other collection classes because, it has unique values, it cannot store
duplicate values, which makes it faster to use as a key in fetching or retrieving.

Q.75) What is the use of Enumerator in Collection Classes?

Ans) Enumerator is used for traversing through the collection class to fetch the element in the collection
class, both enumerator and iterator does the same.

Q.76) Different Tables, Classes involved in Creating, Posting Sales Order and Purchase Order?
Ans) SalesTableType and SaleslineType classes will get called while creating the Sales Orders.
SalesFormLetter_Confirm
SalesFormLetter_Invoice
SalesFormLetter_PackingSlip
SalesFormLetter_PickingLlst
classes will be used to post the sales order at various document status (packing, invoice etc).

Tables:
SalesTable contains all Sales Order headers regardless whether they have been posted or not.
The SalesParmTable and SalesParmLine contain detailed information regarding posting sales headers
and Lines.
CustConfirmJour and CustConfirmTrans tables contain all Sales Confirmation headers and Lines
posted in Dynamic Ax originating from Sales Orders and Lines.
CustPackingSlipJour and CustPackingSlipTrans tables contain all sales Packing Slip headers and Lines
posted in Dynamic Ax originating from Sales Orders and Lines.
CustInvoiceJour and CustInvoiceTrans tables contain all sales all Sales Invoice headers and Lines posted
in Dynamic Ax originating from Sales Orders and Lines.

Purchase Order classes and Tables:


PurchTableType and PurchTableLine classes will get called while creating the Purchase Orders.
PurchFormLetter_PurchOrder
PurchFormLetter_ApproveJournal
PurchFormLetter_Invoice
PurchFormLetter_PackingSlip
PurchFormLetter_ReceiptsList
classes will be used to post the Purchase Order at various document status (packing, invoice etc).
Tables:
PurchTable contains all purchase order headers regardless whether they have been posted or not.
PurchParmTable and PurchParmLine contains detailed information regarding posting Purchase headers
and Lines.
VendPackingSlipJour and VendPackingSlipTrans tables contain posted packing slip headers and lines.
VendInvoiceJour and VendInvoiceTrans tables contain all invoiced purchase order headers and Lines.
VendReceiptsJour and VendReceiptsTrans tables contain posted receipt header and lines.
VendPurchOrderJour and VendPurchOrderTrans tables contain Purchase requisition headers and lines.

How to create Sales Order :


http://www.dynamicsaxtraining.com/dynamics-ax-trade-and-logistics-training/create-sales-order

Q.77) What is a Full-Text Indexes in Ax?


Ans) Ax 2012 provides full text functionality that enables Ax to search the business data over a large
volume of text data or documents.
we can create full text indexes on tables of type Main and Group.
Before we use full text functionality in application we must configure SQL Server full text.
How to create a Full Text Index:
http://msdn.microsoft.com/EN-US/library/gg845129.aspx
How to use :
http://msdn.microsoft.com/EN-US/library/gg879757.aspx
Q.78) What are the different Table Type Property in Ax?
Ans) In Ax- 2012 all tables have TableType property that replaces Temporary property found in Ax-
2009.

Regular: The default value. These are permanent Tables.These tables are used for storing data
permanently in database.
InMemory: These temporary tables are hosted in the client, the data will wipe out as soon as instance of
the form or report is closed.
Joins and other Set operations with InMemory tables are usefull inefficient.
These tables are same thing as what was previously called a temporary table in ax 2009.
An InMemory table is held in memory until its size reaches 128 KB. The dataset is then written to a disk file
on the server tier.
The disk file for an InMemory table has the naming convention $tmp<nnnnnnnn>.$$$.
http://msdn.microsoft.com/EN-US/library/bb314749.aspx
TempDB: This is the new type of temporary table that is hosted in the sql server database.
These temporary tables can be joined in the database with regular tables.
Joins and other Set operations on TempDB tables are can be efficient.This was the joining problem we
have InMemory Tables.
http://msdn.microsoft.com/EN-US/library/gg845661.aspx

Q.79)Difference between InMemory table and Container?


Ans) Data in containers are stored and retrieved sequentially, but an InMemory table enables you to
define indexes to speed up data retrieval.

• An index is of no benefit if you are working with only a few records. In such cases a container might
involve less overhead and perform faster than an InMemory table.
Another important difference between InMemory tables and containers is how they are used in method
calls.
When you pass an InMemory 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, an InMemory table may provide better performance
than a container.

Q.80) What are the different Set Based Operations used in Ax?
Ans) insert_recordset:
insert_recordset is a record set-based operator, which performs operations on multiple records at a time.
However, it can fall back to record-by-record operations in many situations.
insert_recordset copies data from one or more tables directly into one resulting destination table on a
single server trip.
Using insert_recordset is faster than using an array insert. However, array inserts are more flexible if you
want to handle the data before you insert it.
Example:

insert_recordset myTable (myNum, mySum)


select myNum, sum(myValue)
from anotherTable
group by myNum
where myNum <= 100;
update_recordset:
The X++ SQL statement update_recordset enables you to update multiple rows in a single trip to the
server.
This means that certain tasks may have improved performance by using the power of the SQL server.

update_recordset resembles delete_from in X++ and to UPDATE SET in SQL. It works on the database
server-side on an SQL-style record set, instead of retrieving each record separately by fetching, changing,
and updating.
AOT-->Tables-->SlaesTable-->Methods-->updateDeadlineOnline()
delete_from:
You can delete multiple records from a database table by using a delete_from statement.
This can be more efficient and faster than deleting one record at a time by using
the xRecord.delete method in a loop.
If you have overridden the delete method, the system interprets the delete_from statement into code
that calls the delete method one time for each row that is deleted.
AOT-->Tables-->SlaesTable-->Methods-->deleteAllLines
public static void deleteAllLines(SalesId _salesId)
{
SalesLine salesLine;
ttsbegin;
delete_from salesLine where salesLine.SalesId == _salesId;
ttscommit;
}
Q.80) What are the different Method modifiers in Ax?
Ans) There are several modifiers that can be applied to method declarations.

Public: Methods that are declared as public are accessible anywhere the class is accessible and can be
overridden by subclasses. Methods that have no access modifier are implicitly public.

Private: Methods that are declared as private can be called only from methods in the class where the
private method is declared.
Protected: Methods that are declared as protected can only be called from methods in the class and in
subclasses that extend the class where the method is declared.

final: Indicates that the method cannot be overridden in any class that derives from its class.

Server: Establishes the location where the method is to be executed (on the server).
Can only be used on static methods. If the method is not static, you need to specify the location using the
class property RunOn.

Client: Establishes the location where the method is to be executed (on the client).
Can only be used on static methods. If the method is not static, specify the location by using the class
property RunOn.

abstract : The method is declared but not implemented in a parent class. The method must be overridden
in subclasses.
If you try to create an object from a subclass where one or more of the abstract methods belonging to the
parent class have not been overridden, you will get a compiler error.
Ex: SalesFormLetter

static: Specifies that the method is a class method and does not operate on an object.
static methods cannot refer to instance variables and are invoked by using the class name rather than on
an instance of the class (MyClass::aStaticProcedure()).

Display: Indicates that the method's return value is to be displayed on a form or a report. The value
cannot be altered in the form or report. The return value is typically a calculated value,
for example, a sum.

edit: Indicates that the method's return type is to be used to provide information for a field that is used in
a form. The value in the field can be edited.

Q.81) Write X++ code to create and Post Inventory?


Ans) Create and Post inventory journal by code

InventJournalTable inventJournalTable;
InventJournalTrans inventJournalTrans;
InventJournalNameId inventJournalName;
InventDim inventDim;
JournalCheckPost journalCheckPost;

//Below code creates journal header


inventJournalTable.clear();
inventJournalName = InventJournalName::standardJournalName(InventJournalType::Movement);
inventJournalTable.initFromInventJournalName(InventJournalName::find(inventJournalName ));
inventJournalTable.insert();

//Below code creates journal lines


inventJournalTrans.clear();
inventJournalTrans.initFromInventJournalTable(inventJournalTable);
inventJournalTrans.TransDate = systemDateGet();
inventJournalTrans.ItemId = "MDJ0001";
inventJournalTrans.initFromInventTable(InventTable::find("MDJ0001"));
inventJournalTrans.Qty = 2500;
inventDim.InventSiteId = '12';
inventDim.InventLocationId = '1201';
inventDim.wMSLocationId = 'BULK-001';
inventJournalTrans.InventDimId = inventDim::findOrCreate(inventDim).inventDimId;
inventJournalTrans.insert();

//The below code posts the journal


journalCheckPost = InventJournalCheckPost::newPostJournal(inventJournalTable);
journalCheckPost.run();

You might also like