Dynamics InterView Questions
Dynamics InterView Questions
conlen :- Use conlen to find out how many items there are in a container.
conpeek :- Use conpeek to extract an item from a container, and to convert it into another data type
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
Edit Indicates that the method's return type is to be used to provide information for a field that is used in in a form. The value in the field can
be edited.
3. Difference between perspectives and table collection
Perspectives can organize information for a report model in the Application Object Tree (AOT).
A perspective is a collection of tables. You use a report model to create reports.
Table collection is a collection of table, which sharing across all the virtual companies.
4.What are the 4 types of files we need to copy to the standard folder?
Virtual company accounts contain data in certain tables that are shared by any number of company accounts. This allows users to post
information in one company that will be available to another company.
8.From which table u can get the user permissions stored in Ax?
AccessRightList table.
12.What is an index?
An index is a table-specific database structure that speeds the retrieval of rows from the table. Indexes are used to improve the performance of
data retrieval and sometimes to ensure the existence of unique records.
13.Define IntelliMorph
IntelliMorph is the technology that controls the user interface in Microsoft Dynamics AX. The user interface is how the functionality of
the application is presented or displayed to the user.
IntelliMorph controls the layout of the user interface and makes it easier to modify forms, reports, and menus.
14.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.
15.Define X++
X++ is the object-oriented programming language that is used in the MorphX environment .
16.Differentiate refresh(),reread(),research(),executequery()
refresh() will not reread the record from the database. It basically just refreshes the screen with whatever is stored in the form cache.
reread() will only re-read the CURRENT record from the DB so you should not use it to refresh the form data if you have added/removed
records. It's often used if you change some values in the current record in some code, and commit them to the database using .update() on the
table, instead of through the form datasource. In this case .reread() will make those changes appear on the form.
research() will rerun the existing form query against the data source, therefore updating the list with new/removed records as well as
updating existing ones. This will honour any existing filters and sorting on the form.
executeQuery() is another useful one. It should be used if you have modified the query in your code and need to refresh the form. It's like
research() except it takes query changes into account.
17.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
18.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.
19. 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
20.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.
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.
21.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
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).
23.How many types of data validation methods are written on table level?
validateField(),validateWrite(),validateDelete(),aosvalidateDelete(),aosvalidateInsert(),
aosvalidateRead(),aosvalidateUpdate().
24.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.
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 record is entered in the table the recid is generated by the kernel.it is unique for each table.
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.
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).
28.How many types of Delete Actions are there in Standard Ax and define the use of each
None
Cascade
Restricted
Cascade+Restricted.
29. If any record is created in table I want to fetch the date & time stamp, how will you do that?
If you only want to capture the date and time that a record is created, just add a field to the table and set that field's Default Value property to
Now() or Date().
This method calls the system methods to execute. It is used to instantiating the variables at the parent class. Used for code redundancy.
31. 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.
32.What are the different types of Table groups defined on table properties?
Miscellaneous
Parameter
Group
Main
Transaction
WorkSheetHeader
WorkSheetLine
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).
Yes, but to open the class from action menu item we have to create main method of class.
Construct(): You should create a static construct method for each class. The method should return an instance of the class.
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.
MenuItems - Client
37.What is main class used in batch process OR which class will you inherit to make a batch job
RunBaseBatch class
- Using RunbaseBatch
Methods,DataSources,Design.
Name, Table, Index, AllowCheck, AllowEdit, AllowCreate, AllowDelete, StartPosition, JoinSource, LinkType.
43.validateWrite() method can be written in form datasource as well as table level, when should we write it in form DS and when in
table. Similar in case of write() method
when we want the validation at the table level means in every form where this table is uses, we can write at the table level.
If we want validations at the particular form and it doesn’t effect to the other forms where this table was used, then we can use form level
validations.
44.How can we call table level methods from form DS (similar methods)
Form init(): init is activated immediately after new and creates the run-time image of the form.
DS init(): Creates a data source query based on the data source properties.
The form data source init method creates the query to fetch data from the database and sets up links if the form is linked to another form.
Form init(), DataSource init(), Form run(), DataSource executeQuery(), canClose(), close().
FormDataSource - executeQuery() and call this method in the design field of the form.
48.What are the different types of menu items available, explain each of them
49.Action type menu item is attached to a form but in the drop down the menu item is not appearing, what could be the problem .
Certainly! The issue might be related to security roles or form personalization. Make sure the user has the right role, and try restoring the form
personalization.
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.
Init(),run(),fetch(),send(),print()
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.
60.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.
61.How can we sort the DS, what facility we can get in by placing fields in Ranges
this.query().datasource(1).addsortfield(fieldnum(tablename,fieldname),sorting:ascending);
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.
65.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.
66. 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.
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
Prevent users from inadvertently breaking an application by changing code or objects on which the application depends.
Tables
Views
Menus
Menu items
Form controls
Report controls
67. Normally what do we attach in Output
Forms
- Classes
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.
70. What are the keywords used to access data from "multiple companies" and "one company to another company".
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.
AOT>Form>DatasSource>Fields>FieldName >Lookup
Form>Design>Field>Lookup.
Refresh(): Updates the form by refreshing the view of all records in the data source.
Reread(): Refreshes the database search defined by the query, specified by the FormDataSource.init method.
MorphXplorer)
The Application Hierarchy Tree enables you to view information about the parents and children of application objects. For example, you can see
all the classes that extend a particular class, or see which data types a particular extended data type inherits from. It also enables you to view the
methods, fields, and indexes that are used by tables. Information is available for application and system classes, tables, and data types.
Right-click the object, and then select Add-Ins > Application Hierarchy Tree.
You need to generate cross-references before you can use the Application Hierarchy Tree.
Tables are listed under the Common node in the Application Hierarchy Tree. All tables extend the system table called Common. Classes are listed
under the Object node.
77.If you want to monitor the database activity, where can you get that?
Administration>Reports>DataBase information
78.Where can we find the Label log and what is its utility?
Tools>DevelopmentTools>Label>Label log.
Use this form to view the history of labels within the system and re-create labels that have been deleted.
Overview Each label is described in terms of its identification (ID), language, status, label text, and by whom and when it was
modified. A label can also contain a description, which is displayed at the bottom of the form.
Button
Recreate Re-create the selected label.
The SysLabelInterval table contains the settings that control the interval of label IDs that are used to create new labels through the label editor
in MorphX.
80.What are the tools you will use to upgrade any object?
- Compare
81.What is the use of System Documentation/Application Developer Documentation/Application Documentation
System Documentation is intended for developers under the functions subnode there are hundreds of useful functions you will use
when programming in x++.
Application Developer Documentation, under this node you find documentation about tables and classes used by Ax. description about tables
and classes for developers.
82.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).
83.What are the classes, Tables, Forms and Methods used to post the purchase orders.
classes will be used to post the PurchaseOrder at various document status (packing, invoice etc). 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.
84.What are the classes, Tables, Forms and Methods used to post the Ledgers.
purchTableType and PurchTableLine classes will get called while creating the PurchaseOrders. classes will be used to post the PurchaseOrder at
various document status (packing, invoice etc). Tables used in purchase order: PurchTable contains all purchase order headers regardless
whether they have been posted or not.
85. What are the classes, Tables, Forms and Methods used to post the Inventory.
86. What is the base class to send the on-boad E-mailing.
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)
Doinsert():These methods should only be used under strict control because they bypass the following:
Any code that was written in the insert, update, and delete methods.
OTHERS-
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++
94. What is cluster installation?
Classes>NumberSequenceReference>LoadModule.
Class Description
Similar to the array type except that it can hold values of any single type, including objects and records.
Array
Objects are accessed in a specific order.
Set Holds values of any single type; used when order is important.
Struct Can contain values of more than one type. Used to group information about a specific entity.
105. What is the difference between sql queries and dynamics queries.
Sql query is Select statement –
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, the user could be scrolling past several orders without immediately
seeing each order lines.
Active: The child data source is updated immediately when a new record in the parent data source is selected. Continuous updates consume lots
of resources.
InnerJoin: Selects records from the main table that have matching 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: Selects records from the main table whether they have matching records in the joined table.
ExistJoin: Selects a record from the main table for each matching record in the joined table.
- 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.
An array can hold only items of same and its declared type. Containers store different types of data types at a time.
You can allocate memory space for an array and fill that space with values later, such as in a loop. This is efficient and performs well.
110. Logic for converting string to uppercase?
StrUpr() -Converts all the letters in a string to uppercase.
111.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.
Write(): Executed when the user inserts a new record or updates an existing one. Calls the FormDataSource.validateWrite method and manages
the database write operation.
Pack():create a pack method to read the state of the object and return it in a container suitable for saving or transporting between tiers. Reading
the state of the object implies collecting the value of all its members. If the members are tables (records, cursors, temporary tables) or classes, it
must also be possible to read their state.
Unpack():create an unpack method that takes the packed state and reinitializes an object with it. Construct the object before creating
an unpack method.
The unpack method takes the saved state of the object and reinitializes the object with it. It reinitializes the object members according to the
values in the container, taking the supplied version number into account.
The method can return a Boolean that signals the result of the initialization process.
1.Services - Enable you to expose business logic written in X++ as a service to be consumed by other applications. Within Microsoft Dynamics
AX, you can create, customize, and publish services.
2.Document services - A specific implementation of services in which the Microsoft Dynamics AX business logic is exposed through document
services.
3.Consume Web services - In Microsoft Dynamics AX, you can consume external Web services from your X++ code.
The Form classes are all system classes and are prefixed with Form.
When you create a report by using Report Builder for Microsoft SQL Server Reporting Services, you are using secure views of the tables available
in the report model.
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.
123. How to create runtime query?
You can create a query to retrieve data by using the query classes.
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.
validateField():Executed when you leave a field in a record. For example, after entering changes to a field on a grid control, you could click
another field in that same record or on a different record. Or you could click another control on that same form.
The super() method invokes field validation checks, as guided by the value of the Validate property.
132. What are the methods required for posting a purchase order?
CacheLookup : Determines how to cache the records retrieved during a lookup operation.
IsLookup : For report models, it specifies whether the table information is incorporated into other tables that reference it when a report model
is generated.
For OLAP cubes, it determines whether to generate a consolidated dimension or a distinct dimension. You can specify one of the following
values.
Yes - Indicates that attributes from the table are to be consolidated into the parent dimension (star schema).
No - Indicates that a separate dimension is to be generated for the table (snowflake schema).
A Microsoft Dynamics AX view is a virtual table that contains the data records and fields that are specified by a query.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.
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.
Views are read-only. The data fields and tables that a view uses cannot be updated from that view.
Benefit Description
Focused data A view enables you to retrieve and return only the data that is relevant for a particular user or scenario.
A view enables you use a complex query to create a highly-customized set of data. For example, a view
Customized data often represents data as a single table that was retrieved from multiple joined tables and used many
conditions.
A view can improve performance by returning only relevant fields to the user. In addition, a view definition
Performance
is compiled which may provide better performance than calling an equivalently complex query.
138. Can you just tell the table properties that you can remember?
140. Primary Key in tables (In dynamics AX don’t have primary key)
The system index is created on the RecId and DataAreaId fields if the DataAreaId field exists. Otherwise the system index is created on the RecId
field. You can see system indexes in the database but they aren't visible in the AOT.
142. What are all the add- on tools you used in Dynamics AX (It’s an indirect question for AIF)
143. Did you work with EP (Enterprise Portal & Workflow) how can you implement this features into your projects?
this & element: this can be used in any objects to reference the current object and member methods.
In forms the collection of objects is contained within a FormRun object. You can reference members in the outer formrun object by using the
element reference.
If your code is placed at the top level there are no functional difference between this and element.
If your code is placed in a formdatasource but this will reference the datasource but element will reference the formrun.
Use this debugger to debug X++ code that is running on the following:
The Microsoft Dynamics AX cross-reference system allows you to see the relationships between objects. You can see the following:
Caching is to remember the information already retrieved from the database and use this memory when the same data is needed again.
Drawback, if the remembered information is no longer valid this could compromise the consistency of the database as the updates are made
based on the invalid data.
Read ahead caching , single record caching, Entire table caching, Record view caching, Display method caching.
The parameter system design pattern holds static setup information for the modules in a company, such as information on the national
currency, the posting method, and so on. There is one instantiation of this pattern per module.
The parameter system should be set up as described in this topic. The parameter record is automatically created by the system and has the
following:
A parameter table
A parameter form
A parameter menu item
There should be one parameter table per module.
Parameter tables have a single record per company, holding the required parameters for the module. The record is cached. To enable the Found-
cache, a key is defined.
Add an integer field called key. It should have the Visible property set to No
Administration>Setup>System>Configuration -- displays all the module configuration keys and we can enable or disable the key from
this form.
By changing the table property to Yes and Use the setTmp table method to make a non-temporary table temporary rather than creating a
copy of the table, and then making it temporary.
158. What is difference between Auto design and Generate design ? If we uses both designs in a report what design will be print?
Interfaces
For tables where the Table Group property has been set to Group, Main, or WorksheetHeader, you must do the following:
Note
Don't set the FormRef property for tables where the MaxAccessMode property is set to NoAccess. These tables are not used in a form.
Specifies the display menu item that is activated when a table is referenced.
When you use a primary index field on a report, this form is available as a link in the report. A primary index is specified by using
the PrimaryIndex property.
If you leave this field blank, the system attempts to display a form that has the same name as the table.
Access Modifiers: All methods of a class are always available to code in the class itself. To control access from other classes, and to control
inheritance by subclasses, X++ has three access control modifiers for methods:
public : Methods that are declared as public can be used anywhere the class is accessible and can be overriddenby subclasses.
protected : Methods that are declared as protected can only be called from methods in the class and in subclasses of the class where the
protected method is declared.
private : Methods that are declared as private can only be called from methods in the class where the private method is declared.
Method Modifiers : abstract ,client,server,display,edit,final,static,public,private,
protected.
Storage dimensions – Site, Ware house, PalletId, Batch number, Serial Number.
166. If we create table relation and EDT relation for the same field in the table which relation the field uses?
Table relation.
A query with in another query is called Composite query. Uses in the Query node in the AOT.
-- No
Report Template: A report template can specify the sections that a report includes, such as a page header and a page footer, page numbers on
each page ,company logo ,the controls included in each section, and the layout of the controls. Only reports based on an Auto design inherit
changes that are made to a report template, Generate design doesn’t inherit changes to report template.
Section template: This makes it possible to define sections one time and reuse them many times. This is used for elements appearing in more
than one report.
171. When you are creating a table what is the default table group?
- Miscellaneous
173. what is the thin and thick or fat client in the configurations?