Pages

Tuesday 31 March 2015

What are the keywords used to access data from multiple companies and one company to another company in AX


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.

Monday 30 March 2015

SSRS Program Flow in AX




  • Controller Class : This class Controls flow of execution of reports.
  • This class is used to perform some task before opening dialog, after closing dialog and before rendering report.
  • It allows users to call the different Designs in a report based on conditions.
  • Controller class also handles arguments passed from other classes and forms.

UI Builder : This class is used to create a dialog and handling events in dialog. Parameters in dialog are fetched from Query and Contract classes.

Contract Class : It consist of Parm methods which can be used for setting or getting values. this class is used for generating UI parameters.

RDP Class : It stands for Report Data Provider. This class contains business logic to populate the report.  
  • Process report is a entry point for the RDP class where this method executes first.
  • Insert method : This method is used to insert the values into the temporary table which are coming from different tables and some calculated fields of the table.
  • Get method : This method is used to return table buffer to the SSRS to process report output based on the temporary fields and data.






How many types of reports are there in AX


Report Types : In AX there are two types of Reports

Query Report
RDP Report

Query Report : We can create reports using AOT Query(static query). This approach is suggested when data is coming direct from tables.

RDP Report : RDP report involves business logic according to the requirement  This logic may be calculations or getting values from different tables based on conditions.

Why do we provide Configuration key & Security Key in AX


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

What is the difference between Auto Design and precision Design in AX


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.

What are the most important methods on the Report in AX



These are the important methods on the reports 

Init(),
run(),
fetch(),
send(),
print().

Difference between Primary & Cluster index in ax


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).

Delete action in Ax2012

There are four delete actions:

None: A None delete action will delete selected row in a table but nothing occurs to the 
table that relate to this table.

Cascade: A Cascade delete action will delete all the records in the related table,
 i.e, deleting the parent record will also delete child record in the related table.

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

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 database.

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


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.

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 in AX


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

Differentiate refresh(), reread(), research(), executequery() in dynamics ax 2012

 x 

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.