Wednesday, December 13, 2017

Get selected records in a grid on a form AX - X++

To get selected record(s) in a grid in AX, we use the MultiSelectionHelper class. To achieve that, follow the steps below:

1.  Create a command button on the form and override the clicked method.
2.  Insert the code below:
 

void clicked()
{
    MultiSelectionHelper          selectionHelper = MultiSelectionHelper::construct();//Create instance of class
    Set                           selectedRecords = new Set(Types::Record);//Declare a set of type record
    MyLinesTable                  tableLines; //Your table buffer
    super();
 
    selectionHelper.parmDataSource(MyLinesTable_DS); //Set the datasource
    tableLines  = selectionHelper.getFirst(); //assign to table buffer the reference to selected record(s)
 
    if (tableLines.RecId)
    {
        while (tableLines)
        {
            selectedRecords.add(tableLines);
            info(strFmt('Selected record.. %1',tableLines.myField));//Display selected record
            tableLines = selectionHelper.getNext();
        }
    }
}
 
3. Select record(s) on the grid then click on the command button to view the selected records.

Thursday, November 2, 2017

Creating SSRS-Reports in Dynamics AX 2012 – What’s no longer possible in AX-reports

Header/Footer:
There is only one header, one body and one footer available per report. It is no longer possible to use a second header or footer (like Prolog/Epilog or Programmable Section) in a report.
This means it is no longer possible to use a secondary footer for an invoice summary with single positions one below the other. To make it worse: Hiding header or footer on a page only means that the content of the header and footer is not displayed. But: The space which would be consumed by the non-hidden header/footer (by setting the height) cannot be used in report and is displayed as a white space in the report.
If header/footer is only displayed on the first or last page of report the size should be set as small as possible to prevent waste of space on the pages where header/footer are not displayed.
Note: Behavior of header/footer vary between running report in Visual Studio or in Dynamics AX 2012 because in Visual Studio a hidden header/footer by Property “Show on first/last page” is not displayed at all and wastes no space.
Missing property “LabelTabLeader” (for automatic setting of colons after labels):
The property “LabelTabLeader” was an AX-standard till Dynamics AX 2009 to set dots and colons automatically after a label like this: “….:”. In SSRS reporting engine for Dynamics AX 2012 this property is no longer available. Even "better": According to Best Practices for designing SSRS reports colons are no longer officially supported.
Workaround suggested by Microsoft Support: Set colons manually with an expression like =":" after every label. Problem: Every default report has to be changed.
We asked for a change request at Microsoft’s SSRS/AX 2012-Team, because we do not have the time to edit every used default report manually. According to Microsoft support re-implementing the “LabelTabLeader”-property is not a simple job and still discussed at Microsoft.
Setting an element in a fixed position at the bottom of the report:
As mentioned above: There is only one report-footer available and because of technical restrictions you cannot size it as big as sometimes needed for example for an invoice summary where the single positions are one below the other. Common requirement is that the invoice summary is based on the bottom of the summary independently of the used space above the summary.
With Dynamics AX 2009 it was rather simple to achieve this requirement: You just used a programmable section only on the last page.
Because there is no second footer available we tried several other things to fix the sales summary at the bottom of the invoice-report but outside the footer. But we always failed.
Microsoft Support confirmed that there is no option in SSRS reporting engine available to fix an element on a specific space on report if it is not possible to place the element in header or footer.
This issue is also topic of a change request, which is also still discussed at Microsoft.
Paper Size of default Dynamics AX 2012 reports: 
According to Microsoft Best Practices an AX 2012 report has to be designed in a way which allows the report to be printed in US letter and also in DIN A4.
Unfortunately most of the default reports are designed in a way which uses US letter paper size in its complete width without proper margins. Because the width of DIN A4 is 210mm and the width of US letter is 216mm a lot of white pages are printed in DIN A4.
This means that a lot of the default reports have to be redesigned to be used proper by users outside USA.
Update 06.02.2012:
Starr informed me that my statement, that all the reports are optimized for US Letter is wrong. He checked some more reports which were not optimized for DIN A4 or US Letter at all. Indeed he is right:
I have checked some of more reports and some paper-sizes I discovered were not neither US Letter nor DIN A4. It seems that when many columns needed to be displayed width was set to fit all columns even the report was not really printable anymore.
He also asked what we do to make the reports printable: Our solution is simple but also time-intensive: Together with our client we identified the most important reports which need to be printed and all these reports will be redesigned. Not because of the wring paper-sizes but also because of the “beautiful” design of the standard-reports.
This was the first part of “What’s no longer possible in AX-reports”. Part 2 will follow soon and there are still some more nasty restrictions of SSRS for Dynamics AX 2012 which were unknown in Morph X-reports for Dynamics AX 2009 and prior.
This is the second part of “What’s no longer possible in AX-reports”. After finishing writing the first part I thought, that I just present some nasty, but not so important restrictions. Unfortunately Microsoft support just confirmed a restriction which could affect report design in a very bad way:
254 column limit in SalesInvoiceTmp (maybe every temporary table filled by a RDP class):
Some days before Christmas I was still designing Sales Invoice-report: After adding 20 new columns to SalesInvoiceTmp-table and implementing these columns in Sales Invoice-report no report-data were shown in the report any longer.
Only label-data were displayed in the report. The behavior was the same when running report in Visual Studio or direct in Dynamics AX. First I thought that this behavior was caused by a programming-mistake by me but I found no reason why X++-code should have caused this. Then I checked SalesInvoiceTmp-table while running the report. SalesInvoiceTmp-table was filled correctly and all needed data were available. Because I had no clue what may have caused this I deleted the before added 20 new columns. Result: Sales Invoice-report worked correctly.
I started adding the columns one by one and after reaching 255 columns in SalesInvoiceTmp-table report just showed label-data again. After deleting one column report just worked fine.
I opened a support case at Microsoft support and just yesterday support confirmed that this behavior is caused by SalesInvoiceTmp-table with more than 254 columns. Support directly opened a change request because this restriction seems to be by design.
If one asks why I need more than 254 columns in SalesInvoiceTmp: Default SalesInvoiceTmp has about 200 columns when delivered with Dynamics AX, because there is just one dataset for header- and detail-data. In the end a programmer just can add approximately 50 columns for customization. 50 columns sound much, but if a client has just some special wishes to be implemented in Sales Invoice-report you may need all of these 50 columns and maybe some more.
SalesInvoiceTmp-table & default AOS settings:
Default maximum buffer-size in AOS settings is 24KB. Recommendation by Microsoft is not to raise this size. When starting customizing Sales Invoice report I had to add start some columns. But after adding some columns with an overall size below 1000 Bytes an error-message appeared, that maximum size of SalesInvoiceTmp-table was reached and columns need to
be deleted.
The answer of Microsoft was fast and simple: Raise maximum buffer-size in AOS settings to 48 KB. This is the only solution to solve this problem and the only possible solution when additional columns need to be added. Because SalesInvoiceTmp-table with about 200 columns by default is very big and so it reaches the 24KB limit very fast.
Till now we found no negative impacts of raising the buffer-size. But according to Microsoft support another raise above 48KB may cause problems.
So the big question is: Why is Sales Invoice report just using SalesInvoiceTmp-table as its only dataset if this solution causes that much trouble? The question gets even more interesting when you check the other reports: Most of them have two datasets. One for header-data and another one for detail –data.
It took me some time to discover the reason, which is simple but also shows another problem of SSRS reporting engine:
Paper-size limits space for report-elements:
When starting redesigning Sales Invoice report I have just deleted the default report because it had a very ugly layout. I was setting paper-size to DIN A4 paper which has a height of 297 millimeters. When starting design there was plenty of space but later in the design-process and after adding more and more design-elements (which were printed one by another as unique elements printed only on the first page, continuing with reoccurring elements for invoice details in the middle section of the report and ending with unique elements only printed on last page) space went short.
So I reexamined the default Sales Invoice report. The solution used in default report is simple: One big table with only one column is used as a container-element. The table has some rows. In every row one report-element is embedded, mostly tables. With this solution it is also possible to print the elements one by another.
The reason why a table is used as container-element is that the table which is used as container element can be bigger than the paper size. When printing the report the paper size which was set in the report properties is used correctly and report-layout is not negatively affected by not wanted page breaks.
The downside of this solution is also the explanation why only one dataset is used: You have to assign a dataset to the table used as container element. But for the elements inside this table you cannot assign other datasets than that one used in the container element table.
This is the reason why Sales Invoice report just as one dataset. To my mind this is a very bad limitation, which makes report designers work a lot of harder.
Enough for today. It seems that a third part of “What’s no longer possible in AX-reports” is needed. 
This is the third and last part of “What’s no longer possible in AX-reports”. Let’s start with some updates of topics I presented in Part I & II.
Update: Setting an element in a fixed position at the bottom of the report
As mentioned in Part I this bug was topic of a change request. Some days ago we became answer by Microsoft support. The change request was rejected. Reason: It’s a known issue of Reporting Services.
Update: 254 column limit in SalesInvoiceTmp (maybe every temporary table filled by a RDP class)
This bug seems to be a bigger one. The bug is confirmed. But why it occurs is still subject of an investigation by Microsoft support-technicians. Here it seems we will have a good chance that this bug will be fixed when it is finally found.
And here a new one:
Differences of displayed data in SSRS Reports in Visual Studio and Dynamics AX
I mentioned in a tweet before. But I think it is too important. So I raise this topic again. Data displayed in a SSRS report started in Visual Studio und a SSRS report started from Dynamics AX 2012 client may show different data.
The differences could be:
– numbers of rows displayed
– (sub)sets of rows displayed
Reasons are that on the one hand Visual Studio does not use the Reporting Engine of Reporting Services but its own. On the other hand each report, which is called via Dynamics AX 2012 client, gets its own unique id, which allows Dynamics AX to identify different reports which were called at the same time / while another report still was processed. This is of significant importance to show only the own data in a report and not data of different reports. If a report is started inside Visual Studio this unique id is ignored and datasets of different reports may be displayed in one report.
Conclusion:
Report Services itself are well known and part of SQL Server since version 2000 (as add on) and on a regular basis since version 2005. Of cause there were some issues when using Reporting Services for typical SQL Server tasks. But in general most time it was fun working with Reporting Services and SQL Server as main data source.
Working with Reporting Services and Dynamics AX 2012 one the other hand could be a little bit (ore some bit more) frustrating. Why? Quite simple! The field of operation is a different one: E.g. Designing a sales invoice with fixed positions of report elements was never subject of my work when working directly with SQL Server data but it is a common need when designing an invoice-template for Dynamics AX.
And that is exactly problem: The “old” Dynamics AX MorphX reporting engine was designed to fit this and most of the other typical Dynamics AX tasks like generation Invoices or other bills and receipts.
SQL Server Reporting Services (as delivered together with SQL Server) is designed to fit most of typical tasks like processing and displaying mass data in a clear and structured way.
Reporting Services delivered with Dynamics AX 2012 is still (let’s say over 80 percent) SQL Server Reporting Services. Lots of the old MorphX report features are missing. In the end this might cause some extra work when building a report which tries to fit the Dynamics AX users’ needs when generating an SSRS-report in Dynamics AX 2012.
My hope is that Microsoft realizes that for many common tasks in Dynamics AX 2012 Reporting Services in its current version is not adequate and a massive increase of functionality and different, more accurate behavior (e.g. when placing report elements) is needed.

Tuesday, July 11, 2017

AX 2012 Compile Application using axbuild command

he new way to compile AX application through command prompt is introduced in AX 2012 CU7. This is much faster than the traditional way of compiling. It takes approx.. 1-2 hours to compile depends on your server

  1. Run command prompt by Run As Administrator
  2. go to  C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\
  3. Use command to run compilation. axbuild.exe  xppcompileall /s=01 /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin"


Notes: -

If you are facing any issue running the command ie: App can't run in this system or Window coming and close immediately then just copy and paste AXBuild.exe files from any working environment.

Tuesday, July 4, 2017

Microsoft Dynamics AX Inventory Tables & Classes Details

The inventDim table is table that holds the combinations of inventory attributes assigned to items at they progress through inventory transactions. For example, an item can be located in many different warehouse, at may different sites, and stored in certain locations. Imagine the number of combinations that can be associated with an items its endless.  Below are the inventory dimensions AX uses to segregate items as they process through the system
InventColorId Item table contains information about colors.
InventSizeId Item table contains information about item size.
ConfigId  table contains information about available configuration of the various items.
InventBatchId table contains information about batches.
InventSerialId table contains information about item serial numbers.
InventLocationId table contains information about warehouses.
InventSiteId table contains information about sites.
wmsLocationId table contains information about locations.
wmsPalletId table contains information about pallets.
The inventTrans table is what I like to call the parent table of all transactions. NO matter what is performed a record will be written to this table when posting occurs. The inventTrans table represents a flow of inventory transactions as data leaves and enters a company for example. If a product is ordered a status field will be set to ordered. If a item is transferred from one warehouse to another warehouse the status will then be set to transfer. The inventory transactions table is typically used for very detailed inventory reports.
InventSum classes are used to find the on-hand information of a certain item at a certain date. The InventOnHand class is used to find the current on-hand information.
InventMovement class validates and prepares data that will be used to generate inventory transactions. All the classes related to the inventMovement class will be prefixed with InvMov
For instance the InvMove_Transfer preps data for inventory transfer journals
The InventUpdate classes are used to insert and update inventory transactions. Whenever a transaction should be posted, the updateNow()method in the correct InventUpdate subclass will execute. The super class in the hierarchy is the InventUpdate class, and the other classes in the hierarchy are prefixed ‘InventUpd_’. For example, InventUpd_Estimated is used whenever an item line is entered in the system that will most likely generate a physical transaction in the future. A good example can be a sales order line that has the on-order sales status. When a line like this is entered or generated in AX, the InventUpd_Estimated is triggered so that the inventory transactions will reflect that the item is on-order can is taken into consideration when the same item is ordered.

Tuesday, May 30, 2017

An Unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected... In AX

Error: 
When trying to create a new record(s) in any table system shows following error
eg. At the time of creating new Sales Order and this error may appear.

Solution:
To resolve this error this TTS level should be ZERO, Run this job to get rid of that error, this job will find the tts level where its greater than zero and make it zero by calling TTSABORT.
static void TheAxaptaResetTTS(Args _args)
{
    while (appl.ttsLevel() > 0)
    {
        info(strfmt("Level %1 aborted",appl.ttsLevel()));
        ttsAbort;
    }
}

Tuesday, May 16, 2017

List of Dynamics Axapta ERP Top companies in the world

Following is a List of Dynamics Axapta ERP Top companies in the world

Godrej Infotech

MSBS Business solutionLogica Sverige AB

Avande Asea Pvt ltd

BDO Dunboody LLP

GMCS verix



ABsys cyborge SA

COSMO Consult

Yokogava solution corporation

2e2 UK ltd

Sonoma partners

veri park

Sable system pty ltd

Second foundation consulting inc

Demand mangement

Dynamic software

Tectura

Sonata


Columbus IT

Other companies in India

Dev Information technology India Pvt Ltd,Ahmedabad

Synoverge, Ahmedabad 

Tieto pune

SHRISHAIL,Noida

 LnT Infotech ,Mumbai

Blue Star InfoTech ,Mumbai

CGI,Bangalore

PRoV International,Chennai

 Hitachi Solutions ,Pune

IL&FS Technologies ,Gurgaon

Indusa,Ahmedabad

Fujitsu,Gurgaon

MPG,Gurgaon

Ali Technologies ,Delhi

 S3 infotech,Noida

Persistent,Pune

NDS Infotech ,Mumbai

Capgemini,Mumbai

KPIT,Pune

TCS,Bangalore

HCL,Noida

GE,Gurgaon

Infosys,Bangalore

CorporateServe,Gurgaon


Zylog,Chennai

Accenture,Bangalore

Levtech ,Bangalore

Ignify,Pune

----------------------------------------------------------------------------------------

Others companies in Ax

USA ERP AX Partner


Location - Company

Arizona -InterDyn BMI

California - Northern Ignify

California - Southern Tridea Partners

Georgia- Tribridge

Illinois- Turnkey Technologies, Inc.

Indiana -enVista

Michigan- Columbus

Mississippi -Clients First Business Solutions

Missouri- Turnkey Technologies, Inc.

Nevada- InterDyn BMI

New Jersey- SBS Group

New Mexico- InterDyn BMI

New York (New York City)- RSM US LLP

New York (Upstate)- AKA Enterprise Solutions

North Carolina -Sunrise Technologies

North Dakota -Stoneridge Software

Ohio -Socius

Oklahoma- Clients First Business Solutions-South Central

Oregon -Collins Computing, Inc.

Texas - Northern Turnkey Technologies, Inc.

Texas - Southern Clients First Business Solutions-South Central

Vermont -Logan Consulting

Virginia -BroadPoint Technologies, LLC

Wisconsin- Indusa



-------------------------------------------------------------------------------------
International ERP AX Partner

Newfoundland & Labrador, Canada- Atum Corporation

England, UK -ANEGIS

Ontario, Canada- SBS Group

Sunday, May 14, 2017

Change SSID after database restore from different database

After restoring data from "ABC" database to "XYZ" database we need to update the admin user in to the current database . Best way to get SSID is to take value from "UserInfo" table. or run below command in command Prompt .

Open command window and write Whoami /user, press enter, and SID will be shown

write below command in SQL .

update userinfo set SID='<SID>', Networkdomain = '<Network_domain_name>', networkalias = '<Network_alias>' where id = 'admin'

Thursday, May 11, 2017

More Latest Interview Questions with Answers for AX Technical Consultant

Latest Interview Questions with Answers for AX Technical Consultant

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
----------------------------------------------------------------------------------------------------------------
Tables Name :-
CustConfirmJour, CustConfirmTrans - when a sales order gets confirmed
CustPackingSlipJour, CustPackingSlipTrans - when a packing slip is posted.
CustInvoiceTable,CustInvoiceTrans - when an invoice is posted.
These are some of the mainly used tables.
******************************************************************************************************************
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.
******************************************************************************************************************
From which table u can get the user permissions stored in Ax :-  AccessRightList table.

******************************************************************************************************************
Difference b/w Abstract class and Interfaces

 

An abstract class may contain complete or incomplete methods. Interfaces can contain only the signature of a method but no body. Thus an abstract class can implement methods but an interface cannot implement methods.
An abstract class can contain fields, constructors, or destructors and implement properties. An interface cannot contain fields, constructors, or destructors and it has only the property's signature but no implementation.
An abstract class cannot support multiple inheritance, but an interface can support multiple inheritance. Thus a class may inherit several interfaces but only one abstract class.
A class implementing an interface has to implement all the methods of the interface, but the same is not required in the case of an abstract Class. Various access modifiers such as abstract, protected, internal, public, virtual, etc. are useful in abstract Classes but not in interfaces. Abstract classes are faster than interfaces.

******************************************************************************************************************

AX 2012 purchase order posting class
confirmation-        purchpurchorderjouranlcreate
reciptlist-                purchreciptlistjournalpost
packingslip-          purchpackingslipjournalpost
invoice-                  purchinvoicejournalpost

*******************************************************************************************************************

How to show current Date in AX 2009

info(date2str(systemdateget(),123,2,1,2,1,4));

*******************************************************************************************************************

AX2012 Create SSRS Report using Data Provides Classes
RDP implements the standard MVC(Model View Controller) design pattern.
·                     Model-view-controller (MVC) is a pattern used to isolate business logic from the user interface.
·                     Model: Responsible for retrieving data and for business logic, this can included queries, data methods, or other classes that are designed to retrieve data.
·                     View: Responsible for the User Interface, this can also be thought of as the design for the report.
·                     Controller: Orchestrates the flow between Model and View

* Create the Contract  Class first,
This class is used to create parm methods for the reports, So if you have any parameters that you want to pass to report then create parm methods for those as data members.

* Create Controller class which extends SrsReportRunController

* SrsReportRunController : Through this class we just create the Main method where you have to define the reportname and design and this was the method which will calls the report to execute. Starting point of the report.

prePromptModifyContract :- If you want to pass the values for the report before prompting to user for input you can override this method

* Create DataProvider class which extends SrsReportDataProviderPreProcess.

override the method ProcessReport where you will write the business logic to fill into thetmp table

Override the postbuild function to bind the lookups for the fields.

**********************************************************************************************
Report data provider class – processes business logic based on parameters and a query, and then returns the tables as a dataset for the report.
***********************************************************************
SRSReportQueryAttribute attribute to specify the query to use to get the data for the report.
***********************************************************************
SRSReportParameterAttribute attribute to specify the data contract class that defines the report parameters for the report.
*****************************************************************************************************************
User Interface (UI) Builder Class is used to define the layout of the parameter dialog box that opens before a report is run in Microsoft Dynamics AX. It is used to add the customization as well as additional fields in the dialog.
Following are the scenarios where UI Builder Class can be used:
1.                      Grouping dialog fields
2.                      Overriding dialog field events
3.                      Adding a customized lookup to a dialog field
4.                      Binding dialog fields with Report contract parameters
5.                      Changing the layout of the dialog
6.                      Adding custom controls to the dialog
To create a UI builder class, extend it with SrsReportDataContractUIBuilder.
SysOperationContractProcessingAttribute(classStr(SSRSDemoUIBuilder))
· it will link the UI Builder Class with the contract class.

 **************************************************************

RDP Class Reports

IMPORTANT CONCEPTS

1.                Report Data Provider (RDP) Class

Report Data Provider Class is an X++ class that is used to access and process data for a SSRS report. The RDP class processes the business logic based on a specified parameter and/or query and returns a dataset to the reporting services. In order to create a RDP class in AX, you have to extend that class withSRSReportDataProviderBase. This tells AX that this class will be used by reporting services to process the data.
Two important attributes are used in RDP classes:
1.       SRSReportQueryAttribute: specifies which AOT query will be used in this report. If the RDP class uses an AOT query to process data, define this attribute at the beginning of the class.
2.       SRSReportParameterAttribute: defines the data contract class that will be used by this report to prompt for parameter values. If the RDP class contains any parameters this define this attribute at the beginning of the class.
Both the attributes are optional. If the report does not use any query or does not want any parameter to filter report data, these attributes do not need to be used.

2.                Data Contract Class

A data contract class is an X++ class which contains parm methods with the DataMemberAttribute defined at the beginning of the method. This class is used to define one or more parameters that will be used in a SSRS report.

3.                Table

An AX table is used as the dataset to store data for the report. The RDP class processes the data and stores it in the table which is then used by a SSRS report to render data.
A table can be a temporary table (InMemory or TempDB) or a regular table, but it is Microsoft best practice to use a temporary table.
The type of temporary table is based upon the performance considerations. InMemory temporary table is used when the data set is small, while TempDB is normally used for larger datasets to improve performance.
*********************************************************************************

List page interaction class and methods

Interaction class of list pages extends SysListPageInteractionBase class. Some handful methods of this class are as follows:

. initializing: Called when the form is initializing – Similar to the form init method
. intializeQuery: Also called when the form is initializing – Similar to the datasource init method
. selectionChanged: Called when the active record changes – Similar to the datasource active method.
. setButtonEnabled: Should be overridden to dynamically enable/disable buttons based on the current selection. This is called from the selectionChanged method.
. setButtonVisibility: Should be overridden to show/hide buttons when the form first opens. This is used more to do a one-off layout adjustment based on system configuration/parameters, as well as the menu-item used to open the form.
*********************************************************************************

What is the Difference between Overriding and overloading?

Overloading is defining functions that have similar signatures, yet have different parameters. 

Overriding is only pertinent to derived classes, where the parent class has defined a method and the derived class wishes to override that function.

Overriding
Overloading
Methods name and signatures must be same.
Having same method name with different
Signatures.
Overriding is the concept of runtime polymorphism
Overloading is the concept of compile time polymorphism
When a function of base class is re-defined in the derived class called as Overriding
Two functions having same name and return type, but with different type and/or number of arguments is called as Overloading
It needs inheritance.
It doesn't need inheritance.
Method should have same data type.
Method can have different data types
Method should be public.
Method can be different access specifies

******************************************************************************

Difference between "Element and This" keyword in AX

Element and This points to the same object in some cases and different in other cases.
In a form method element and this are same and will point to fromRun object, but in the formDataSource method element still points to the formRun object and this points to the formDataSource object.  You cannot use element to refer table or class object.
********************************************************************************************

Difference between formDataSource.query() and formDataSource.queryRun().query()

Any form has 2 instances of the query object - one is the original datasource query (stored in formDataSource.query()), and the other is the currently used query with any user filters applied (stored informDataSource.queryRun().query()). 
When the research method is called, a new instance of the queryRun is created, using theformDataSource.queryRun().query() as the basis. Therefore, if the user has set up some filters on the displayed data, those will be preserved.


This is useful, for example, when multiple users work with a certain form, each user has his own filters set up for displaying only relevant data, and rows get inserted into the underlying table externally (for example, through AIF).
Calling executeQuery, on the other hand, will use the original query as the basis, therefore removing any user filters.
*********************************************************************************************

Dynamics Ax 2009 Layers

Dynamics AX 2009 consists of sixteen application object layers that contain all the
elements you see in the AOT.
These layers can be looked at as an onion with multiple layers. In the middle is the
core application in the SYS layer and the outermost layer is the user layer USR.
Therefore, when any application element is being executed the system will look at
the outermost code layer first to see if there is any code for that element; if not, it peels a layer off the onion, and tries the next layer. When it hits a layer where the element exists, it will use the code from this layer, and will not continue to peel off layers to find code for that element in the innermost layers. 

Layers with their description

SYS The standard application is implemented at the lowest level, 
the SYS layer.The application objects in the standard 
application can never be deleted.

GLS Country/region specific changes will be developed in GLS 
Layer.For e.g as you all know that Tax structure differs 
from country to country.So such localization functionality 
can be developed in GLS layer.

HFX HFX is an application object patch layer reserved by 
Microsoft for future patching or other updates.

SL1, SL2,or SL3 A layer where the distributor can implement 
vertical partner solutions. 

BUS When a business partner creates their own generic solution, 
their modifications are saved in the BUS layer and the top-
level application objects are used.

VAR Value Added Resellers (VAR) can make modifications or new 
developments to the VAR layer as specified by the customers 
or as a strategy of creating an industry-specific solution. 
Such modifications are saved in the VAR layer.

CUS The supervisor or administrator of an end user installation 
might want to make modifications that are generic to the 
company. Such modifications are saved in the CUS (CUStomer) 
layer.

USR End users might want to make their own modifications, such 
as in their reports.These modifications are saved in the USR 
layer.
**********************************************************************************************

How we can use multiple datasets in a tablix?         

SQL Server Reporting Services 2008 R2 has introduced a new function called “LOOKUP”. LOOKUP function is used to retrieve the value from multiple datasets based on 1 to 1 mapping. For example if we have two datasets and both the datasets have EmpID so based on the EmpID mapping, we can retrieve the data from both the datasets


ITERATORS VS. ENUMERATORS05MAY

We can traverse our collections by using either an enumerator or an iterator.But there is no clarity why sometimes iterator fails while on other occasions it is flawless.Simply what we do is that just replace iterator with the enumerator.
First theoretically what happens behind the scenes is as follows:
When collection classes were first introduced in DAX, the iterator was the only option.Butbecause of a few unwarranted drawbacks that appear as hard-to-find errors, enumerators were added, and iterators were kept for the backward compatibility.
******************************************************************************

Debug::assert

This method allows to check if some Boolean condition evaluates to true and if it doesn't - stop further execution and show stack trace. Debug::assert() should be used to validate some assumptions made in the code which should never happen if nothing is broken in the application. It means that wrong user input should not be asserted but rather validated by normal if statement and exception should be thrown if the input is wrong. However, if the code relies, for example, on query data source name, which can be broken only in development time - that is a good place to add assert to.
*************************************************************************************************************

1.  Difference between following:
·                     condel :- Use condel to delete one or more items from a container.
·                     confind :- Use confind to locate a sequence of items in a container. 
·                     conins :- Use conins to insert some items into a container.
·                     conlen :- Use conlen to find out how many items there are in a container.
·                     connull :- Use connull to explicitly dispose of the contents of a container.
·                     conpeek :- Use conpeek to extract an item from a container, and to convert it into another data type  
·                     conpoke :- Use conpoke to replace (poke) an item in a container.

2. Difference between edit and display method?
·                     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 ApplicationObject 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?
           *.aod, *.ahd, *.ald, *.add, *.khd
 5.  Why we use virtual companies?
     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.
6. How can we restrict a class to be further extended?
        using Final Keyword for ex: public final class <ClassName>
7.Which are classes are used for data import export?
        SysDataImport and SysDataExport
8. From which table u can get the user permissions stored in Ax?
       AccessRightList table.
9.What should we do if we need last record to be active when a form is opened?
      In properties of datasource table set the StartPosition property as last.
10. What is the sequence of events while a report is generated?
      Init, Run, Prompt, Fetch, 
Print
11. Name few X++ classes/Coreclasses related to Queries?
     Query, QueryRun, QueryBuildRange, QueryBuildDataSource, QueryBuildLink
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
**************************************************************************************************************
1. X++ Maps: it can be used as a temp data store for the given scope of a process. This takes us less over head, and is much quicker than a TempTable. For Further reading
2. AOT Maps: A map can unify the access to similar columns and methods that are present in multiple tables. 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. Methods on maps enable you to create or modify methods that act on the table fields that the map references. 

Conversion of Disposition code, code was not specified - Error in D365 F&O for inter company purchase order return

 We crated the return order for inter company purchase order  and created a Item Arrival Journal through Arrival Overview in corresponding c...