Followers

5 March 2016

Custom Reference Group in Dynamics AX

Microsoft Dynamics AX 2012 introduced a new form control type as Reference Group

So go to your form data source and find the reference field for which you want to perform the lookup. override the lookupReference method.

    We can construct a query,add data sources and ranges  and then pass it to SysReferenceTableLookup, like the below code :


public Common lookupReference(FormReferenceControl _formReferenceControl)
{
    SysReferenceTableLookup     sysRefTableLookup;
    Query                       lookupQuery = new Query();
    QueryBuildDataSource        lookupQueryDataSource;
 
    // Construct the SysRefTableLookup object
    sysRefTableLookup = SysReferenceTableLookup::newParameters(tableNum(MyTable), _formReferenceControl)
 
    // Add the field list that will be displayed on the lookup form
    sysRefTableLookup.addLookupfield(fieldNum(MyTable, MyFirstField));
    sysRefTableLookup.addLookupfield(fieldNum(MyTable, MySecondField));
 
    // Construct the query's data source
    lookupQueryDataSource = lookupQuery.addDataSource(tableNum(MyTable));
 
    // Add ranges to the query data source
    lookupQueryDataSource.addRange(fieldNum(MyTable, MyFirstField)).value(queryValue(''));
    lookupQueryDataSource.addRange(fieldNum(MyTable, MySecondField)).value(queryNotValue(''));
 
    // Pass the query to the lookup object
    sysRefTableLookup.parmQuery(lookupQuery);
 
    return sysRefTableLookup.performFormLookup();
}

4 January 2016

Today Am exploring the new aspect related to financial dimensions in ax2012


Earlier version AX2009, 4.0 :

  • In  older version system used to create the limited dimensions.
  • By default system is available 3 dimensions such as  cost center,Department and purpose. These dimensions are referred as dimension[0],dimension[1],dimension[2]..
New version AX2012, 6.0 :

  •   In new version ,their is no limit to create the dimensions. Create N no.of  dimensions as   per the organization requirements.
  •  Financial dimensions master table dimension is replaced with DimensionAttribute and DimensionValueDetails. 
  • To store these dimensions on customized table insted of  EDT should add DimensionDefault EDT.
How to access the Financial dimensions values in AX2012:

             access the dimensions values in ax2009,  for example

               SalesTable.dimension[0] == Department  value
               SalesTable.dimension[1] == Costcenter  value
               SalesTable.dimension[2] == purpose value
               

        
                             
 code:

    public DimensionValue getDefaultDimensionValue(DimensionDefault _dimensionDefault,Name        _dimensionName)
{
   DimensionAttributeValueSetItemView    dimAttrsetView;
   DimensionAttribute                                   dimensionattr;
   ;
       

  select dimAttrsetView where dimAttrsetView.DimensionAttributeValueSet
          == _dimensionDefault   
    
       join dimensionattr where dimensionattr.RecId == dimAttrsetView.DimensionAttribute
                                && dimensionattr.Name == _dimensionName;
  
                           return dimAttrsetView.DisplayValue;

       }

29 December 2015

Form templates in AX2012

    The Form templates is series of design patterns for Microsoft Dynamics AX , it displaying the different types of data for user.

    They are 8 different predefined Form templates in AX 2012.


  1)  List page
  2)  Details Form Master
  3)  Details Form Transactions
  4)  SimpleListDetails
  5)  Simple List
  6)  TableOfContents
  7)  Dialogue
  8)  DropDialog

 The following table shows , the available form templates and where we should be used.
      
 

 Example of templates :

The following path gives example of each form template


 
 
    To create a form using template, right click the form node in AOT, Select new form from template and then select the template.
                    
          



 

21 December 2015

Different databases for AX2012 in Sql Server

Different databases for AX2012 in Sql Server
                                  

Databases include the MicrosoftDynamics AX DataBase , Model and  Baseline DataBase


  1. The Application Object Server(AOS) connects to Microsoft Dynamics AX to run the process of Transactions.
  2. AOS connects  to the  model store to display the Application elements such as Tables,forms and reports.
  3. Baseline database contains the  model store,i.e  used to upgrade the X++ code to Microsoft Dynamics AX 2012.

                 The baeline database is used to analaze the application updates before they are applied .

          Microsoft Dynamics AX have other components such as Managment Reporter and Enterprise portal also have the databases. That databases is communicate with  these databases (AX Database, Model and Baseline database).          

20 December 2015

Method Calling Sequences of Tables in AX2012


When  you Press Ctrl+N

initValue()

When you change the data in Field

ValidateField() --> ValidateFieldValue --> ModifiedField() --> ModifiedFieldValue()


When you close the table after entering the data

ValidateWrite() --> Insert() --> aosValidateInsert()


When you open table which will contain data

If table contain 5 records , this method will call 5 times --> aosValidateRead()


When you save the record for 1st time

ValidateWrite() --> Insert() --> aosValidateInsert()


When you modify the record and saving

ValidateWrite() --> Update() --> aosValidateUpdate() 


When you delete the record

ValidateDelete() --> Delete --> aosValidateDelete()