Showing posts with label Dynamics Ax 2012 R3. Show all posts
Showing posts with label Dynamics Ax 2012 R3. Show all posts

How to write X++ methods on the list page Form in Dynamics AX 2012

Scenario: I have a menu item that calls some class to execute business logic on the list page Form. List pages do not allow writing of code on the Form, as they used interaction class.

Solution: You can write the code on list page buttons by setting DisplayTarget property to “Client” from auto, as shown in the below Fig:1.0


Fig: 1.0
Note: After this change, you won’t be able to use this button on the EP, so if you are thinking of using the same list page on the EP and planning to use the same button there, then do not do it. However if you are using only the Rich client Form then you are good to do this.

Proud To Be a DAX Developer :-) 

How To: Create & Use AOT Maps In Ax2012

  • Maps are also known as Table Maps/AOT MapsTable Map is a element/object the makes possible to link/associate map fields with fields(same type with different names) in different tables.
  • like, I have create a MAP with field (AccountNum) and Same field exist in CustTable and also in VendTable,so I can associate field in CustTable and in VendTable with Maps, so basically  Maps enables to access the fields with different name in different tables.
Procedure For Creating a AOT Map:
  • I created a Map by navigating to AOT>Data Dictionary>Maps and right click and new and gave it name ‘MapTest’.

  • I have created 4 fields under Fields node in Map (Best Practice drag and drop from EDT).

  • Now the next thing I need to do is to associate the fields in map witch i created with the fields in different tables, let say I am taking two tables (CustTable and VendTable).

Notice that above, four fields that I have created in Maps also exist in CustTable as well as VendTable with different names.


  • To associate fields, go to Mapping node, right click it and click New mapping and enter the table that you want to associate in Mapping Table field as following,

SSRS Tip: Creating Multiple Data Regions In SSRS Reports

Hi Friends,
Today i'll demonstrate how to create multiple data regions/ groups in SSRS reports. A data region in simple definition is a subreport report that shares the parameters and datasets, and is present inside the report design itself. 
  • This and the following procedure will help you understand how multiple data regions can be created in SSRS. The first of the two data regions will display the detailed customer transactions.
Note: 1. 1st we have to create a query using CustTrans and CustTable tables and with following fields as shown below.
           2. We are using "AutoDesign" report while creating reports.  
  • Create a PktCustTransList query, which includes the CustTable and CustTrans tables. Remove the unwanted fields and retain only the fields that are shown in the following screenshot:

  • Open Visual Studio and create a new Report Model Project named PktCustTransReport and create a dataset that refers to the PktCustTransList query.
  • When selecting the fields in the query window, select all the fields and the name data method from CustTable.

How To: Use Date Effectiveness Feature in Ax 2012

  • Date effectiveness is a new feature in Dynamics AX 2012 allowing developers to easily create date range fields.
  •  Date ranges are used for defining record validity between the specified dates, for example, defining employee contract dates.
  • This feature significantly reduces the amount of time that developers spend writing code and also provides a consistent approach to implement data range fields.

Note: > We will implement date range validation on the standard E-mail templates form.
          > This Example(Data, Tables, Forms etc etc) is given on the base of Contoso Domain
          > You ll also find an Xpo File To Download at the end of the example.
          > While importing into your AOT it ll ask for replacing the existing one, you can replace it with the new table and form. 

Procedure:





  • 1. In the AOT, find the SysEmailTable table and change its property as shown below 
  • :
  •  






  • Property --> 
  • ValidTimeStateFieldType : Date

    2. Notice the two new fields that are automatically added to the table :




    3. Add the newly created ValidFrom and ValidTo fields to the existing emailIdIdx index
    and change the properties shown in the following table:


    4. The index should look similar to the following screenshot: