Wednesday, March 20, 2013

Debugger tool

How to install debugger:

  1. Start Microsoft Dynamics AX Setup.Under Install,select Microsoft Dynamics AX components.
  2. Advance through the first wizard pages.
  3. If the Setup Support files have not yet been installed on this computer, the Select a file location page is displayed. The Setup Support files are required for installation. Provide a file location or accept the default location, and then click Next. On the Ready to install page, click Install.
  4. On the Select installation type page, click Custom installation, and then click Next.
  5. On the Select components page, select Debugger, and then click Next.
  6. On the Prerequisite validation results page, resolve any errors. When no errors remain, click Next.
  7. If you are installing on a 64-bit operating system, the Select a file location page is displayed. Select the location where you want to install 32-bit versions of Microsoft Dynamics AX files, and then click Next.
  8. On the Prerequisite validation results page, resolve any errors. When no errors remain, click Next.
  9. On the Ready to install page, click Install.
  10. After the installation is completed, click Finish to close the wizard.
How to enable debugger:

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

Debugger Windows:



1.Variables window displays the values of the variables that are within the current scope. When the value of a variable has changed between stops, it is highlighted in a different color in the variables window to make it easy to identify the changes.
2.Call Stack window in the Microsoft Dynamics AX debugger displays the stack method calls. This lets you see which method called the one that is currently being shown. The Call Stack window displays only X++ code frames. No kernel code is shown.
3.The Watch window in the Microsoft Dynamics AX debugger displays a user-defined range of variables.
4.The Breakpoints window in the Microsoft Dynamics AX debugger displays an overview of the breakpoints that are set in:
  • The Microsoft Dynamics AX client
  • The Application Object Server (AOS)
  • Microsoft Dynamics AX Business Connector
5.The Output window in the Microsoft Dynamics AX debugger has separate views that display text written to the window from X++ code and kernel code. These views organize the information that is sent to the Output window.

for more information:
http://msdn.microsoft.com/EN-US/library/aa569670.aspx

shortcut keys for debugger:

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

Note: We have to find out all the breakpoints AOT>Forms>SysBreakpoints in Ax-2009

     

 

Wednesday, March 13, 2013

about classes

class:A class is a software construct that defines the data and methods of the specific concrete objects that are subsequently constructed from that class.
The data represents the state of the object.
The methods represent the behavior of the object.

for more information about class: http://msdn.microsoft.com/en-us/library/aa868834.aspx

Variables are the data for the class. Variables in an X++ class are specific to objects that are constructed from that class. Every object constructed from the class declaration has its own copy of the variables. Such variables are known as instance variables. You cannot declare static variables in X++.
Methods:Methods are the sequences of statements that operate on the data. Methods are typically declared to operate on the instance variables of the class, and are known as instance methods or object methods. In X++ you can also declare static methods.

for more information about method : http://msdn.microsoft.com/en-us/library/aa673265.aspx
How to create a class in AOT:  http://msdn.microsoft.com/en-us/library/aa631180.aspx

Types of classes:There are two types of classes
1.Application classes.
2.System classes or kernel classes.

1.Application classes are implemented in X++.
They are available in the Classes node in the AOT.

 for more information about all application classes:
 http://msdn.microsoft.com/en-us/library/aa573512.aspx

2.System classes, sometimes called kernel classes, are implemented in C++.
They are listed under the AOT >System Documentation > Classes node .
However, the source code for these classes is not available.
for more information about all system classes:
http://msdn.microsoft.com/en-us/library/aa853470.aspx

Methods in X++ :

http://msdn.microsoft.com/en-us/library/aa673265.aspx

Wednesday, February 20, 2013

About index

index: An index is a table-specific database structure that speeds the retrieval of rows from a table.

Uses: Indexes are used to improve the performance of data retrieval and occasionally to ensure the existence of unique records.

location in AOT: AOT>Data Dictionary>Tables

* Once created, indexes are managed automatically by the DBMS every time a record is inserted, updated, or deleted.

* An index is defined by one or more fields.
*  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.

  • Types of index: unique or primary
                              Non-unique or cluster
    unique or primary:Whether an index is unique is defined by the index's AllowDuplicates property. When this property is set to No, a unique index is created.
    The database prevents you from inserting records with duplicate key values by rejecting the insert
    Non-unique:Setting the index's AllowDuplicates property to Yes creates a non-unique index.
    These indexes allow you to enter duplicate values for the indexed fields and are used for performance reasons.
    Note: A field of data type memo or container cannot be used in an index.
    system index:Microsoft Dynamics AX requires a unique index on each table so if there are no indexes on a table or all the indexes are disabled, a system index is automatically created.
    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.

    How to create an index: 
    http://msdn.microsoft.com/EN-US/library/aa607289.aspx

    Table Keys:
    http://msdn.microsoft.com/EN-US/library/hh812105.aspx

    Difference between primary and cluster index:

    Primary index: this index used to organize both the data store and other indexes for more efficient updating and faster access.
    cluster index: this index are created for performance reasons. they provide a quick way of retriving data, instead of performing a full-table search of all the records in the table.
    Difference between Index and Index Hint :
     
    Index: when you add the statement "index MyIndex",  the axapta kernel will add an "ORDER BY" with all the fields of the index.
    Index Hint: when you add the statement "index hint MyIndex", the axapta kernel will add a statement to instruct the database to use that index and no other one.
     




    Thursday, February 14, 2013

    How to change from one layer to another layer

    The default current layer that is used by Microsoft Dynamics AX is set during the client installation. By default, the current layer is set to USR.
    How to change the current layer from USR to another layer when Microsoft Dynamics AX is started.

    To change the current layer:

    1. Click Start, point to Control Panel, point to Administrative Tools, and then click Microsoft Dynamics AX 2012 Configuration. The Microsoft Dynamics AX Configuration Utility opens.
    2. In the Microsoft Dynamics AX Configuration Utility, click Manage, and then click Create configuration. The Create Configuration window opens.
    3. In the Configuration name field, enter a name for the configuration, and then click OK. The Create Configuration window closes.
    4. On the Developer tab, in the Application object layer to open field, select a new layer from the drop-down list.
    5. Click OK to save the configuration. The Microsoft Dynamics AX Configuration Utility window closes.
    6. Close and restart the client in the new layer.

    Wednesday, February 6, 2013

    What is Extended DataType and Benfites

    Extended data types (EDTs) are user-defined types, based on the primitive data types boolean, integer, real, string, and date, and the composite type container.
    You can also base EDTs on other EDTs.

    Benfits:
    1. Code is easier to read because variables have a meaningful data type. For example, Name instead of string.
    2. The properties you set for an EDT are used by all instances of that type, which reduces work and promotes consistency.
    Ex: account numbers (AccountNum data type) have the same properties throughout the system.
    3. You can create hierarchies of EDTs, inheriting the properties that are appropriate from the parent and changing the other properties.
    Ex: the ItemCode data type is used as the basis for the MarkupItemCode and PriceDiscItemCode data types.

    Declartion of EDT variables:

    // A UserGroupID (integer) variable is declared and initialized to 1.
    UserGroupID groupID = 1;
    // An Amount (real) variable is declared.
    Amount currency;

     

     

    update_recordset with joins

     update_recordset with joins update_recordSet storeTransfer         setting      TransactionId = transfertable.TransferId     join transfert...